Skip to content

Instantly share code, notes, and snippets.

@ksverdlov
ksverdlov / boot_alert.sh
Last active October 13, 2022 10:28 — 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>
@zhujunsan
zhujunsan / README.md
Last active January 16, 2024 09:15
OpenWRT Dnspod.cn DDNS

OpenWRT DDNS Dnspod.cn Support

Tested OpenWRT DDNS version: 2.8.2-11

Add following two file to file system after installed luci-app-ddns

Change the following files name, replace _ with /

Thanks to https://github.com/nixonli/ddns-scripts_dnspod

@mykolaharmash
mykolaharmash / init.lua
Last active August 15, 2023 08:45
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

Bring-up Cheatsheet

U-Boot

Boot using .scr

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

CONFIG_CMD_RUN=y
@ihciah
ihciah / README.MD
Last active February 2, 2024 00:08
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.

@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'}
@van800
van800 / RiderUnityIntegration.cs
Last active November 9, 2017 16:29
Unity3D JetBrains Rider cross-platform Integration
moved to https://github.com/JetBrains/Unity3dRider
@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'))
@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;
@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 ()