Skip to content

Instantly share code, notes, and snippets.

@royshil
royshil / AndroidCamera2TouchToFocus.java
Last active May 4, 2024 02:51
How to implement Touch-to-Focus in Android using Camera2 APIs
//Override in your touch-enabled view (this can be differen than the view you use for displaying the cam preview)
@Override
public boolean onTouch(View view, MotionEvent motionEvent) {
final int actionMasked = motionEvent.getActionMasked();
if (actionMasked != MotionEvent.ACTION_DOWN) {
return false;
}
if (mManualFocusEngaged) {
Log.d(TAG, "Manual focus already engaged");
return true;
@knuxify
knuxify / post.py
Created September 16, 2021 05:06
#!/usr/bin/env python3
"""
posts to thoughts.page
"""
import argparse
from bs4 import BeautifulSoup
import sys
from urllib import request, parse
SESSION_ID = 'get the session-id from the session_id cookie'
@Kwonstig
Kwonstig / clades.json
Created June 28, 2023 14:15 — forked from trvrb/clades.json
ncov-clades-schematic
{
"name": "19A",
"color": "#462EB9",
"children": [
{
"name": "20A",
"color": "#4580CA",
"children": [
{
"name": "20B",

Interview Questions

Node.js

Q1: What do you mean by Asynchronous API? ☆☆

Answer: All APIs of Node.js library are aynchronous that is non-blocking. It essentially means a Node.js based server never waits for a API to return data. Server moves to next API after calling it and a notification mechanism of Events of Node.js helps server to get response from the previous API call.

Source: tutorialspoint.com

@igv
igv / adaptive-sharpen.glsl
Last active May 4, 2024 02:13
Optimal sharpening strength (according to objective metrics) - 0.5. Can be applied only to luma channel (change OUTPUT to LUMA). To use it on-demand add the following line to input.conf: n change-list glsl-shaders toggle "~~/adaptive-sharpen.glsl"
// Copyright (c) 2015-2021, bacondither
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer
// in this position and unchanged.
// 2. Redistributions in binary form must reproduce the above copyright
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@andrewxhill
andrewxhill / README.md
Last active May 4, 2024 02:06
A list of frameworks for decision making and where they are most helpful.
Framework (starter video) Internal & External Factors Analysis Competitive Environment Analysis Product/Market Growth Strategy Performance Measurement Decision Path Analysis Financial Evaluation Risk Identification & Management Organizational Alignment
SWOT Analysis
PESTLE Analysis
@albertsadday
albertsadday / future-sticky-navigation-with-glas-effect.markdown
Created October 7, 2023 05:05
Future Sticky Navigation with Glas Effect

Future Sticky Navigation with Glas Effect

A really cool modern sticky navigation with a glass effect and a menu button. Only Vanilla JS and (S)CSS.

A Pen by albertsadday on CodePen.

License.

@JT501
JT501 / MyDatabaseTokenRepository.php
Last active May 4, 2024 01:31
Laravel Custom Reset Password Token
<?php
namespace App\Providers\Passwords;
use Illuminate\Auth\Passwords\DatabaseTokenRepository;
class MyDatabaseTokenRepository extends DatabaseTokenRepository
{
/**
* [Override]