Skip to content

Instantly share code, notes, and snippets.

View tabjy's full-sized avatar
🖐️
🐟

Kangcheng Xu tabjy

🖐️
🐟
View GitHub Profile
from pyspark import SparkConf, SparkContext
import sys
assert sys.version_info >= (3, 5) # make sure we have Python 3.5+
# add more functions as necessary
def toTupples(line):
frags = line.split(" ")
return (frags[0], (frags[1], frags[2], frags[3], frags[4]))
@tabjy
tabjy / fish_shell_local_install.sh
Created October 19, 2016 18:57 — forked from masih/fish_shell_local_install.sh
Installs Fish Shell without root access
#!/bin/bash
# Script for installing Fish Shell on systems without root access.
# Fish Shell will be installed in $HOME/local/bin.
# It's assumed that wget and a C/C++ compiler are installed.
# exit on error
set -e
FHISH_SHELL_VERSION=2.3.1
@tabjy
tabjy / say.sh
Created January 12, 2016 10:17 — forked from zshbleaker/say.sh
say command in OS X
say --voice="Agnes" Isn't it nice to have a computer that will talk to you?
say --voice="Albert" I have a frog in my throat. No, I mean a real frog!
say --voice="Alex" Most people recognize me by my voice.
say --voice="Alice" Salve, mi chiamo Alice e sono una voce italiana.
say --voice="Alva" Hej, jag heter Alva. Jag är en svensk röst.
say --voice="Amelie" Bonjour, je m ’ appelle Amelie. Je suis une voix canadienne.
say --voice="Anna" Hallo, ich heiße Anna und ich bin eine deutsche Stimme.
say --voice="Bad News" The light you see at the end of the tunnel is the headlamp of a fast approaching train.
say --voice="Bahh" Do not pull the wool over my eyes.
say --voice="Bells" Time flies when you are having fun.
@tabjy
tabjy / mimetype.json
Last active April 15, 2020 07:01 — forked from lsauer/gist:5196979
JavaScript List of selected MIME types (JSON)
"lsauer.com , lo sauer 2013"
"JavaScript List of selected MIME types"
"A comprehensive MIME List is available here: https://gist.github.com/lsauer/2838503"
"mime": {
"a": "application/octet-stream",
"ai": "application/postscript",
"aif": "audio/x-aiff",
"aifc": "audio/x-aiff",
"aiff": "audio/x-aiff",
@tabjy
tabjy / node-and-npm-in-30-seconds.sh
Created December 9, 2015 07:04 — forked from isaacs/node-and-npm-in-30-seconds.sh
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh