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! MyGetProjectPath(path) | |
python << EOF | |
import os | |
import vim | |
def get_project_dir(path): | |
find_project_file = False | |
while not find_project_file: | |
files = os.listdir(path) | |
if ".vimproj" in files: | |
find_project_file = True |
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
{-# LANGUAGE OverloadedStrings, TypeFamilies, QuasiQuotes, | |
TemplateHaskell, GADTs, FlexibleContexts, | |
MultiParamTypeClasses, DeriveDataTypeable #-} | |
import Yesod | |
import Yesod.Auth | |
import Yesod.Form.Nic (YesodNic, nicHtmlField) | |
import Yesod.Auth.BrowserId (authBrowserId) | |
import Data.Text (Text) | |
import Network.HTTP.Conduit (Manager, newManager, def) | |
import Database.Persist.Sqlite |
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
echo "export LC_ALL=en_US.UTF-8" >> ~/.bashrc | |
export LC_ALL=en_US.UTF-8 | |
apt-get update | |
apt-get install -y supervisor git subversion mercurial tmux | |
if [ ! -e ~/golang ]; then | |
mkdir ~/golang | |
fi | |
echo "export GOPATH=~/golang" >> ~/.bashrc |
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
place holder. |
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() |
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
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
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
# 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
""" | |
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) |
OlderNewer