This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Youku Fix Cna | |
// @namespace myfreeer | |
// @version 0.1 | |
// @description 为Youku提供cna cookie | |
// @author myfreeer | |
// @match http://v.youku.com/* | |
// @match https://v.youku.com/* | |
// @license MIT | |
// @run-at document-start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Class AsyncThread: Async-based threading | |
* @license BSD-3-Clause | |
*/ | |
class AsyncThread extends Array { | |
/** | |
* @typedef {Object} task | |
* @property {*} data - [optional] argument of `resolver` | |
* @property {Function} resolver - a function that takes `data` as the only argument, returns Promise | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <windows.h> | |
#include <stdlib.h> | |
int main(int argc, char *argv[]) { | |
if (argc < 2) return 1; | |
char *ptr; | |
unsigned long time = strtoul(argv[1], &ptr, 10); | |
if (ptr[0] != argv[1][0]) { | |
Sleep(time); | |
return 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define UNICODE | |
#define _UNICODE | |
#include <windows.h> | |
//main entry | |
int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nShowCmd) { | |
const int cmdLineLength = lstrlenW(lpCmdLine); | |
if (cmdLineLength == 0) { | |
return 1; | |
} | |
for (int i = 0; i < cmdLineLength; i++) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <windows.h> | |
wchar_t *getCurrentDirW(void) | |
{ | |
static wchar_t buffer[MAX_PATH]; | |
GetCurrentDirectoryW(MAX_PATH, buffer); | |
return buffer; | |
} | |
char *getCurrentDirA(void) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- mpv userscript to make mpv play videos on top when playing and playback window height larger then screen height | |
local was_ontop = true | |
-- specify screen height here | |
local screen_height = 768 | |
function playbackEventListener(name, value) | |
local ontop = mp.get_property_native("ontop") | |
local dheight = mp.get_property_native("dheight",0)*mp.get_property_native("window-scale",0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* xargs - Make and execute commands Author: Ian Nicholls: 1 Mar 90 */ | |
/* | |
* xargs - Accept words from stdin until, combined with the arguments | |
* given on the command line, just fit into the command line limit. | |
* Then, execute the result. | |
* e.g. ls | xargs compress | |
* find . -name '*.s' -print | xargs ar qv libc.a | |
* | |
* flags: not any |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let crctable = function() { | |
let c = 0, | |
table = typeof Int32Array !== 'undefined' ? new Int32Array(256) : new Array(256); | |
for (let n = 0; n !== 256; ++n) { | |
c = n; | |
for (let x = 0; x < 8; x++) { | |
c = c & 1 ? -306674912 ^ c >>> 1 : c >>> 1; | |
} | |
table[n] = c; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: 1.0.{build} | |
build_script: | |
- cmd: >- | |
C:\msys64\usr\bin\pacman -Syyuu --noconfirm | |
C:\msys64\usr\bin\pacman -Suu --noconfirm | |
appveyor DownloadFile https://gist.github.com/myfreeer/c8df0b2acbf97e8b391ca741e5248f3f/raw/tinycc-build.sh | |
set MSYSTEM=MINGW64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- settings | |
-- key_binding: press the key specified below | |
-- to cycle between denoise filters below, | |
-- set it to nil to disable the binding | |
local key_binding = "n" | |
-- key_binding_reverse cycle between denoise filters below | |
-- in reverse order, set it to nil to disable the binding, | |
-- set it to a single-char string to enable | |
local key_binding_reverse = nil |