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
const net = require('net'); | |
const fs = require('fs'); | |
const reloadCMD = "\x20\x00\x00\x00\x13\x00\x00\x00\x01\x00\x00\x00\x04\x00\x00\x00\x0e\x00\x00\x00reload_scripts\x00\x00" | |
// start godot client at first /Applications/Godot.app/Contents/MacOS/Godot -d --remote-debug 127.0.0.1:8008 | |
const port = 8008; | |
const server = net.createServer(); |
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
Verifying my Blockstack ID is secured with the address 1LBRU2Pu2jQfXqVELfP3VyfunRDXDZoydb https://explorer.blockstack.org/address/1LBRU2Pu2jQfXqVELfP3VyfunRDXDZoydb |
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
# -*- coding: utf-8 -*- | |
""" | |
A simple blockchain. | |
""" | |
import sys | |
import requests | |
import hashlib | |
import json | |
from urllib.parse import urlparse | |
from time import time |
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
const ua = navigator.userAgent.toLowerCase(); | |
export function isWechat() { | |
return /micromessenger/i.test(ua); | |
} | |
export function isAndroid() { | |
return /android/i.test(ua); | |
} |
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
""" | |
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy) | |
BSD License | |
""" | |
import numpy as np | |
# data I/O | |
data = open('input.txt', 'r').read() # should be simple plain text file | |
chars = list(set(data)) | |
data_size, vocab_size = len(data), len(chars) |
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
# coding=utf-8 | |
import re | |
import os.path | |
import sys | |
import json | |
PATH = os.path.dirname(os.path.abspath(__file__)) | |
def get_file_name(name): |
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
sudo defaults write /Library/Preferences/com.apple.windowserver DisplayResolutionEnabled -bool YES; | |
sudo defaults delete /Library/Preferences/com.apple.windowserver DisplayResolutionDisabled; | |
// by the way, you need to logout and log back in for this to take effect. Or at least that's what | |
// Quartz Debug says. Who knows, maybe it's lying? | |
// P.S. Go to [Apple menu --> System Preferences --> Displays --> Display --> Scaled] after logging | |
// back in, and you'll see a bunch of "HiDPI" resolutions in the list to choose from. |
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
function hackElement(el){ | |
var priceText = el.getElementsByTagName("tr")[0].getElementsByTagName("td")[1].innerText.replace(/[,$]/g, ""); | |
var tickText = el.getElementsByTagName("tr")[1].getElementsByTagName("td")[1].innerText.replace(/,/g, ""); | |
if (priceText === "" || tickText === "") { | |
return; | |
} | |
var price = parseInt(priceText); | |
var tick = parseInt(/(\d+)\/tick/.exec(tickText)[1]); | |
var value = price/tick; | |
var tbody = el.getElementsByTagName("tbody")[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
#!/bin/bash | |
if [ "$1" == "" ]; then | |
echo Usage: $0 pngfile | |
exit 0 | |
fi | |
FILE=`basename $1 .png` | |
if [ ! -e $FILE.png ]; then |
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
from iup import nil | |
from os import nil | |
when isMainModule: | |
discard iup.open(nil, nil) | |
iup.show(iup.dialog(iup.label("Hello, world!"))) | |
iup.mainLoop() | |
iup.close() |
NewerOlder