Skip to content

Instantly share code, notes, and snippets.

View airbob's full-sized avatar
🕳️
let simple = simple; let complex = possible

airbob airbob

🕳️
let simple = simple; let complex = possible
View GitHub Profile
@airbob
airbob / gist:26446e65143570f3e6930e3a8d140fc2
Created September 1, 2022 07:18
galaxy.eco/githubConnect
gid:skpFHMqbdVWSvGpDRXq7dG
@airbob
airbob / build.sh
Created December 3, 2019 14:20 — forked from madhikarma/build.sh
xcodebuild script
#!/bin/sh
set -eo pipefail
IFS=$'\n\t'
# Constants
NOW=$(date +%s)
BUILD_FILE_NAME="MyApp-${NOW}"
SCHEME="MyApp"
WORKSPACE="MyApp"
PROJECT="MyApp"
@airbob
airbob / jasoncharleshill.py
Created October 10, 2019 11:55
A Python script to crawl all project images from jasoncharleshill.com, I use them as my mac wallpaper
# -*- coding: utf-8 -*-
import os
import re
import urllib
from bs4 import BeautifulSoup as Soup
URL_REG = re.compile(r'(https://[^/\\]+)', re.I)
IMG_REG = re.compile(r'<img[^>]*?src=([\'"])([^\1]*?)\1', re.I)
@airbob
airbob / readme.md
Last active August 29, 2015 13:56
python read&processing&write big files

background

Below is input File format(*.txt):

userID month date hour totalTW totalQs result
21535110 05 01 02 3 2 1
21535110 05 01 03 3 2 1
21535110 05 01 06 1 0 0
21535110 05 02 02 1 0 0
#!/bin/sh
setup_brew () {
if ![-f "/usr/local/bin/brew"]; then
/usr/bin/ruby -e "$(/usr/bin/curl -fsSL https://raw.github.com/mxcl/homebrew/master/Library/Contributions/install_homebrew.rb)"
fi
}
setup_ipython () {
brew install readline
import os
def split(filehandler, delimiter=',', row_limit=10000,
output_name_template='output_%s.csv', output_path='.', keep_headers=True):
"""
Splits a CSV file into multiple pieces.
A quick bastardization of the Python CSV library.
Arguments: