Skip to content

Instantly share code, notes, and snippets.

@dtmilano
dtmilano / android-select-device
Last active November 29, 2023 09:29
Script to select one connected device or emulator when running adb
#! /bin/bash
#=====================================================================
# Selects an android device
# Copyright (C) 2012-2022 Diego Torres Milano. All rights reserved.
#
# The simplest way to invoke this script is creating a function like
# this one in your shell startup file:
#
# ```
# adb ()
@kyze8439690
kyze8439690 / CursorAdapter2
Created October 19, 2014 06:07
CursorAdapter used for RecyclerView
package me.yugy.cnbeta.widget;
import android.content.Context;
import android.database.ContentObserver;
import android.database.Cursor;
import android.database.DataSetObservable;
import android.database.DataSetObserver;
import android.os.Handler;
import android.support.v7.widget.RecyclerView;
import android.view.ViewGroup;
@yvele
yvele / line-by-line-rxjs-node.js
Created October 22, 2015 09:52
Line by line file reading with RxJS on Node.js
var Rx = require('rx');
var readline = require('readline');
var fs = require('fs');
var rl = readline.createInterface({
input: fs.createReadStream('lines.txt')
});
var lines = Rx.Observable.fromEvent(rl, 'line')
.takeUntil(Rx.Observable.fromEvent(rl, 'close'))
@van800
van800 / RiderUnityIntegration.cs
Last active November 9, 2017 16:29
Unity3D JetBrains Rider cross-platform Integration
moved to https://github.com/JetBrains/Unity3dRider
@casouri
casouri / init.lua
Created April 7, 2018 02:18
sequential key bindings in hammerspoon
-- key to break out of every layer and back to normal
escapeKey = {keyNone, 'escape'}
-- max length of helper measured in character
recursiveBindHelperMaxLineLengthInChar = 80
-- format of helper, the helper is just a hs.alert
recursiveBindHelperFormat = {atScreenEdge=2,
strokeColor={ white = 0, alpha = 2 },
textFont='SF Mono'}
@ihciah
ihciah / README.MD
Last active August 19, 2024 12:56
A reverse proxy for Telegram Bot API on Aliyun Function Compute / Cloudflare Workers

A reverse proxy for Telegram Bot API on Aliyun Function Compute / Cloudflare Workers

To help users in China mainland access telegram api stably and conveniently with low cost, this script maybe the one you need.

The server-less means you don't have to run a server to proxy the requests, just pay as you go.

Usage

Edit key_prefix, set it to the prefix of you bot address(like /bot563441998:) can avoid abusing.

Bring-up Cheatsheet

U-Boot

Boot using .scr

To enable this feature you need the following U-Boot config:

CONFIG_CMD_RUN=y
@mykolaharmash
mykolaharmash / init.lua
Last active September 15, 2024 09:19
Hammerspoon Vim Navigation
-- put into ~/.hammerspoon
-- map Caps Lock key to Control in macOS settings (Keyboard -> Modifier Keys...)
-- Give all the accessability permissions in Hammerspoon preferences
-- NOTE: Changing "Key repeat rate" and "Delay until repeat" in macOS settings
-- require Hammerspoon restart to pick up those changes.
-- See: https://github.com/Hammerspoon/hammerspoon/issues/3264
local function pressFn(mods, key)
if key == nil then
key = mods
@zhujunsan
zhujunsan / README.md
Last active January 16, 2024 09:15
OpenWRT Dnspod.cn DDNS
@ksverdlov
ksverdlov / boot_alert.sh
Last active November 1, 2024 19:04 — forked from joshspicer/boot_alert.sh
[OpenWrt] Telegram alert when a new wireless device associates with access point. (http://spcr.me/openwrt-alert)
#!/bin/sh
# Alerts via telegram after OpenWRT reboot, start monitoring and list of currently connected wireless devices.
# write-up at: spcr.me/openwrt-alert
# Some modifications: https://gist.github.com/ksverdlov/33a26fed4c4413171171de86ba59c74f
# ~ note ~
# Call from in /etc/rc.local
APIKEY=<YOUR_BOT_API_KEY_HERE>