Skip to content

Instantly share code, notes, and snippets.

@Tydus
Tydus / FortuneCookie.js
Last active October 13, 2023 18:33
FortuneCookie.js
Game.Win('Third-party');
if(FortuneCookie === undefined) var FortuneCookie = {};
if(typeof CCSE == 'undefined') Game.LoadMod('https://klattmose.github.io/CookieClicker/' + (0 ? 'Beta/' : '') + 'CCSE.js');
FortuneCookie.name = 'Fortune Cookie';
FortuneCookie.version = '2.17';
FortuneCookie.GameVersion = '2.022';
FortuneCookie.launch = function(){
FortuneCookie.init = function(){
FortuneCookie.isLoaded = 1;
@Tydus
Tydus / howto-standalone-toolchain.md
Last active May 4, 2023 13:43
How to install Standalone toolchain for Android

HOWTO Cross compiling on Android

5W1H

What is NDK

NDK (Native Develop Toolkit) is a toolchain from Android official, originally for users who writes native C/C++ code as JNI library. It's not designed for compiling standalone programs (./a.out) and not compatible with automake/cmake etc.

What is Standalone Toolchain

"Standalone" refers to two meanings:

  1. The program is standalone (has nothing connect to NDK, and don't need helper scripts to run it)
  2. The toolchain is made for building standalone programs and libs, and which can used by automake etc.

(Optional) Why NDK is hard to use

By default, NDK uses android flavor directory structure when it's finding headers and libs, which is different from GNU flavor, so the compiler cannot find them. For Example:

@Tydus
Tydus / waifu2x.py
Last active May 30, 2022 07:16
waifu2x in 15 lines of Python by @marcan42
import json, sys, numpy as np
from scipy import misc, signal
from PIL import Image
infile, outfile, modelpath = sys.argv[1:]
model = json.load(open(modelpath))
im = Image.open(infile).convert("YCbCr")
im = misc.fromimage(im.resize((2*im.size[0], 2*im.size[1]), resample=Image.NEAREST)).astype("float32")
planes = [np.pad(im[:,:,0], len(model), "edge") / 255.0]
for step in model:
o_planes = [sum([signal.convolve2d(ip, np.float32(kernel), "valid")
@Tydus
Tydus / labyrinth_bind.js
Last active April 21, 2021 14:58
fiddler script for labyrinth bind
import System;
import System.Windows.Forms;
import Fiddler;
// INTRODUCTION
// This is the FiddlerScript Rules file, which creates some of the menu commands and
// other features of Fiddler. You can edit this file to modify or add new commands.
//
// The original version of this file is named SampleRules.js and it is in the
// \Program Files\Fiddler\ folder. When Fiddler first starts, it creates a copy named
@Tydus
Tydus / config_vwifi.sh
Created December 7, 2016 14:38
config virtual wi-fi APs
#!/bin/sh
#=======================================
# config_vwifi.sh
# Config virtual wi-fi (bridge to vlans)
#=======================================
# show which port you have by `robocfg show'
PORT_LIST="0t 1t 2t 3t 4t 8t"
@Tydus
Tydus / CookieMonster.js
Created December 19, 2019 14:16
CookieMonster.js
/**********
* Header *
**********/
CM = {};
CM.Backup = {};
CM.Cache = {};
@Tydus
Tydus / ifrename.sh
Last active October 29, 2017 12:09
Rename ethx and wlanx to persistent names for OpenWrt
#!/bin/sh
# ifrename.sh: rename ethx and wlanx to persistent names
# Dependency: ip ethtool
# See also: https://github.com/systemd/systemd/blob/master/src/udev/udev-builtin-net_id.c
# TODO: currently only support pci-e devices
ip -br l | cut -d' ' -f1 | while read i; do
prefix=$(echo "$i" | cut -c-2)
@Tydus
Tydus / mnist.py
Last active November 4, 2016 15:38
mnist.py
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets('MNIST_data', one_hot=True)
import tensorflow as tf
sess = tf.InteractiveSession()
weight_variable = lambda shape: tf.Variable(tf.truncated_normal(shape, stddev=0.1))
bias_variable = lambda shape: tf.Variable(tf.constant(0.1, shape=shape))
conv2d = lambda x, W: tf.nn.conv2d(x, W, strides=[1, 1, 1, 1], padding='SAME')
詩月カオリ - [Chasse #01] Chasse
詩月カオリ - [Chasse #02] Change Of Heart
KOTOKO - [daily-daily Dream #01] daily-daily Dream
川田まみ - [Get my way! #02] 青空と太陽
桂ヒナギク starring 伊藤静 - [HiNA #01] Steppin'
桂ヒナギク starring 伊藤静 - [HiNA #02] Power of Flower
桂ヒナギク starring 伊藤静 - [HiNA #05] 100点満点なんかじゃない!
ELISA - [Wonder Wind #01] Wonder Wind
三千院ナギ&綾崎ハヤテ starring 釘宮理恵&白石涼子 - [カラコイ~だから少女は恋をする~ #01] カラコイ~だから少女は恋をする~
三千院ナギ starring 釘宮理恵 - [ハヤテのごとく! キャラクターCD ~カバーズ~ selected by Kenjiro Hata #01] 虹色のSneaker
@Tydus
Tydus / gist:7962154
Last active December 31, 2015 08:39
ProtoShares Balances as at 32000 1
Piev8TMX2fT5mFtgxx2TXJaqXP37weMPuD 40000
PgsuLoe9ojRKFGJGVpqqk37gAqNJ4ozboD 36003
PvCGhufumKbzmv8BHAG5SeXVRwUW3etVPd 30000
PgBqNfhXY6DAWRFKiao3E5ADsnYiQ83wGt 10999
PmrBYp4PzMYaixdaxQeQLEdXXtCVJsb7HQ 9996.93
PeTDLjj1mvH8dHNDrbpf2JegGhHetMdHqH 9823.26
PvfQUa2kRLKirTFaufseULNYZBZTJbw3QE 9285.14
PhZyybKdAWaLQAvtiGCfoGegNStpjN6URF 8542.93
PqZxGA2dS84zuSVAnTp6Gznhk7LX9ksCXD 8336.02
Pcr9yRyr2WvqZTWTERzmrTNMEQnWJY2pco 7516.25