Skip to content

Instantly share code, notes, and snippets.

View Yukaii's full-sized avatar
👾
nyan, nyan, nyan

Yukai Huang Yukaii

👾
nyan, nyan, nyan
View GitHub Profile
@zetavg
zetavg / codeship_rails_opsworks_deploy.sh
Last active August 29, 2015 14:14
The script used to deploy Rails apps to AWS OpsWorks via Codeship.
#!/bin/sh
#
# The script used to deploy Rails apps to AWS OpsWorks via Codeship.
#
# It requires the following environment variables to be set:
#
# - AWS_ACCESS_KEY_ID
# - AWS_SECRET_ACCESS_KEY
# - APP_NAME
# - S3_BUCKET
@zetavg
zetavg / set-app.sh
Last active August 29, 2015 14:14
`bin/rake` tasks and `bin/rails console` with ease on AWS OpsWorks Instances running Unicorn Rails App Server.
# $ curl -L http://git.io/opsru_setapp > set-app.sh
# $ . set-app.sh app_name
#
# cd into app directory and sets the environment variables
# on AWS OpsWorks Instances running Unicorn Rails App Server.
APP_NAME=$1 && \
cd "/srv/www/${APP_NAME}/current" && \
export RAILS_ENV=production && \
cat "/srv/www/${APP_NAME}/shared/config/unicorn.conf" | grep ENV > "/tmp/${APP_NAME}_env" && \
@loisaidasam
loisaidasam / fix_ipython_warning.sh
Created February 17, 2014 21:30
A script to fix that annoying ipython DeprecationWarning
#!/bin/bash
# A script to fix that annoying ipython deprecation warning for
# "DeprecationWarning: With-statements now directly support multiple context managers"
# via https://github.com/matematikaadit/matematikaadit.github.io/issues/29
FILENAME=`ipython locate`/profile_default/startup/00-disable-deprecation-warning.py
if [ ! -f $FILENAME ]
then
@juniorz
juniorz / import.rb
Created January 5, 2012 10:15 — forked from ngauthier/import.rb
Import a blogger archive to jekyll (octopress version)
require 'rubygems'
require 'nokogiri'
require 'fileutils'
require 'date'
require 'uri'
# usage: ruby import.rb my-blog.xml
# my-blog.xml is a file from Settings -> Basic -> Export in blogger.
data = File.read ARGV[0]
cd hackmd-0.5.0
patch -p1 < x.patch
mkdir public/vendor/abcjs/
wget https://raw.githubusercontent.com/paulrosen/abcjs/master/bin/abcjs_basic_2.3-min.js -O public/vendor/abcjs/abcjs_basic_2.3-min.js

Base: Hackmd 0.5.0 (https://github.com/hackmdio/hackmd/releases/tag/0.5.0)

@xuwei-k
xuwei-k / Procfile
Last active September 29, 2017 21:00
deploy gitbucket to heroku
web: java -Xmx768m -jar gitbucket.war --port="$PORT"
@nuthatch
nuthatch / gist:983606
Created May 20, 2011 19:31
set Typeface to all TextViews in a ViewGroup for Android
// recursively apply typeface to our textviews
static final void setTypeface(ViewGroup viewGroup, Typeface typeface)
{
if (viewGroup == null) return;
int children = viewGroup.getChildCount();
Log.d(TAG, "setTypeface " + viewGroup + " : " + children);
for (int i=0; i<children; i++)
{
View view = viewGroup.getChildAt(i);
@chirag04
chirag04 / Install.md
Last active March 29, 2019 03:49
compile rocksdb as backend for asyncstorage

Credits

All credit to @sahrens for sharing fb's internal implementation.

Setup

  • clone rocksdb from https://github.com/facebook/rocksdb.

  • edit MakeFile inside rocksdb. Search for Platform-specific compilation around line 1122. Make th next few lines to look like this:

ifeq ($(PLATFORM), IOS)
# For iOS, create universal object files to be used on both the simulator and
@parndt
parndt / gist:11381872
Last active May 29, 2019 11:59
Asset precompilation from an Engine's initializer
### RAILS 4.1
# Doesn't work, due to the error:
# Asset filtered out and will not be served: add
# `Rails.application.config.assets.precompile += %w( refinery/refinery.css )`
# to `config/initializers/assets.rb` and restart your server
class MyEngine < Rails::Engine
# set the manifests and assets to be precompiled
initializer "refinery.assets.precompile" do |app|
@ronnywang
ronnywang / points.csv
Last active September 18, 2019 14:03
We can't make this file beautiful and searchable because it's too large.
x,y,xmin,ymin,xmax,ymax
120.04444241524,23.079425783524,120.04417419434,23.079198766901,120.04471063614,23.079652800146
120.09097337723,23.091476650507,120.0908446312,23.09127926701,120.09110212326,23.091674034005
120.09626269341,23.23268044398,120.09618759155,23.232631150184,120.09633779526,23.232729737776
120.09650945663,23.232631150184,120.09644508362,23.232591715148,120.09657382965,23.232670585221
120.09575843811,23.22219022985,120.09554386139,23.22196346124,120.09597301483,23.22241699846
120.09478211403,23.218680152593,120.09477138519,23.218670292716,120.09479284286,23.218690012471
120.09228229523,23.15273091414,120.09200334549,23.152573078668,120.09256124496,23.152888749613
120.0921857357,23.090973322588,120.09217500687,23.090904238364,120.09219646454,23.091042406812
120.09240031242,23.090667378167,120.0923037529,23.090627901467,120.09249687195,23.090706854866