Skip to content

Instantly share code, notes, and snippets.

@quietlynn
quietlynn / jquery.gplus.js
Last active October 4, 2015 13:37
jQuery Google+ plugin
/*
jQuery Google+ plugin
Copyright (C) 2012 Jingqin Lynn
Includes jQuery
Copyright 2011, John Resig
Dual licensed under the MIT or GPL Version 2 licenses.
http://jquery.org/license
Includes Sizzle.js
var request=require('request');
exports.client_secret='q-tA1vMJhkoeoucVH7NfvryX';
exports.client_id='545553600905.apps.googleusercontent.com';
exports.app_version=13196;
exports.request=function(access,data,uid,callback){
if(typeof data == 'string'){
//refresh token
var qs=require('querystring');
var option={
url:'https://accounts.google.com/o/oauth2/token',
@zhangyubaka
zhangyubaka / Dockerfile.mingw64
Last active March 5, 2022 04:28
Dockerfile for build aria2-fast for windows
# Dockerfile to build aria2 Windows binary using ubuntu mingw-w64
# cross compiler chain.
#
# $ sudo docker build -t aria2-mingw - < Dockerfile.mingw
#
# After successful build, windows binary is located at
# /aria2/src/aria2c.exe. You can copy the binary using following
# commands:
#
# $ id=$(sudo docker create aria2-mingw)
@lizy14
lizy14 / tunet-masks.txt
Created January 28, 2018 06:37
清华大学校园网 IP 地址段
59.66.0.0/16
101.5.0.0/16
101.6.0.0/16
118.229.0.0/19
166.111.0.0/16
183.172.0.0/15
202.112.39.2/32
219.223.168.0/21
219.223.176.0/20
@BenjaminPoncet
BenjaminPoncet / ffmpeg-wrapper
Last active September 14, 2024 06:05
Synology VideoStation ffmpeg wrapper with DTS, EAC3 and TrueHD support. This project is no longer maintained: Please see the following projects: https://github.com/darknebular/Wrapper_VideoStation/ - https://github.com/AlexPresso/VideoStation-FFMPEG-Patcher
#!/bin/bash
rev="12"
_log(){
echo "$(date '+%Y-%m-%d %H:%M:%S') - ${streamid} - $1" >> /tmp/ffmpeg.log
}
_log_para(){
echo "$1" | fold -w 120 | sed "s/^.*$/$(date '+%Y-%m-%d %H:%M:%S') - ${streamid} - = &/" >> /tmp/ffmpeg.log
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 10.
"year","state","state_po","state_fips","state_cen","state_ic","office","candidate","party","writein","candidatevotes","totalvotes","version","notes"
1976,"Alabama","AL",1,63,41,"US President","Carter, Jimmy","democrat",FALSE,659170,1182850,20171015,NA
1976,"Alabama","AL",1,63,41,"US President","Ford, Gerald","republican",FALSE,504070,1182850,20171015,NA
1976,"Alabama","AL",1,63,41,"US President","Maddox, Lester","american independent party",FALSE,9198,1182850,20171015,NA
1976,"Alabama","AL",1,63,41,"US President","Bubar, Benjamin """"Ben""""","prohibition",FALSE,6669,1182850,20171015,NA
1976,"Alabama","AL",1,63,41,"US President","Hall, Gus","communist party use",FALSE,1954,1182850,20171015,NA
1976,"Alabama","AL",1,63,41,"US President","Macbride, Roger","libertarian",FALSE,1481,1182850,20171015,NA
1976,"Alabama","AL",1,63,41,"US President","","",TRUE,308,1182850,20171015,NA
1976,"Alaska","AK",2,94,81,"US President","Ford, Gerald","republican",FALSE,71555,123574,20171015,NA
1976,"Alaska","AK",2,94,81,"US Presid
@1a57danc3
1a57danc3 / FUCK APPLE OCSP
Last active July 28, 2022 12:46
FUCK APPLE OCSP
127.0.0.1 ocsp-lb.apple.com.akadns.net
127.0.0.1 ocsp-cn-lb.apple.com.akadns.net
127.0.0.1 ocsp.apple.com.download.ks-cdn.com
127.0.0.1 k128-mzstatic.gslb.ksyuncdn.com
127.0.0.1 ocsp.apple.com.cdn20.com
127.0.0.1 ocsp.g.aaplimg.com
127.0.0.1 ocsp.apple.com
127.0.0.1 ocsp.digicert.com
@bluewalk
bluewalk / Fix_standby_battery_drain_MBPro-BigSur.md
Last active July 12, 2023 17:16
Fix standby battery drain Macbook Pro - Big Sur

Fixing standby battery drain issue Macbook Pro - Big Sur

1. Reboot into recovery mode

  1. Disable FileVault (System Preferences -> Security & Privacy -> FileVault -> Turn Off Filevault)
  2. Boot to recovery mode by holding Command + R during boot

2. Preparation

  1. Open Terminal
  2. Run csrutil authenticated-root disable to disable signature validation on the bootable snapshots
  3. Run ioreg -l | grep board-id to get your board ID and write it down.
@kaseiwang
kaseiwang / usage.sh
Last active November 28, 2023 08:52
write and clear cloudflare's clientid in wireguard
# listening port and client_id is hardcoded in wgcf_bpf_helper.c
# compile
clang -O2 -target bpf -c wgcf_bpf_helper.c -o wgcf_bpf
# attach ingress
ip link set dev eth0 xdpdrv obj wgcf_bpf sec wg-cf-xdp-ingress
# remove ingress
ip link set dev eth0 xdpdrv off
# enable tc
@alanzchen
alanzchen / popclip-chatgpt.js
Last active September 13, 2024 18:50
PopClip Actions using ChatGPT.
// #popclip extension for ChatGPT
// name: ChatGPT Quick Actions
// icon: iconify:logos:openai-icon
// language: javascript
// module: true
// entitlements: [network]
// options: [{
// identifier: apikey, label: API Key, type: string,
// description: 'Obtain API key from https://platform.openai.com/account/api-keys'
// }]