Skip to content

Instantly share code, notes, and snippets.

@prusswan
prusswan / backports for rake-compiler + mingw_w64 4.6
Last active June 20, 2022 07:47
ruby backports for building against mingw_w64 4.6 using rake-compiler
1.9.1-p243:
r31351 + r27300 # mingw-w64 issue with truncate/ftruncate (http://bugs.ruby-lang.org/issues/4564)
r28811 # x86_64 mingw defines stati64 (http://bugs.ruby-lang.org/issues/2588)
r26311 # redefinition of 'struct timezone' (http://bugs.ruby-lang.org/issues/2587)
1.8.6-p398:
r28144 + r28223 # winsock2 issue (http://bugs.ruby-lang.org/issues/3382)
@prusswan
prusswan / .bash_aliases
Last active August 29, 2015 13:58
My favorite settings for Ubuntu
# Customize BASH PS1 prompt to show current GIT repository and branch.
# by Mike Stewart - http://MediaDoneRight.com
# SETUP CONSTANTS
# Bunch-o-predefined colors. Makes reading code easier than escape sequences.
# I don't remember where I found this. o_O
# Reset
Color_Off="\[\033[0m\]" # Text Reset
@prusswan
prusswan / install.sh
Last active August 29, 2015 14:09
ruby 1.9.3 rbenv tcl tk
sudo ln -s /usr/lib/x86_64-linux-gnu/libtcl8.5.so.0 /usr/lib/libtcl8.5.so.0
sudo ln -s /usr/lib/x86_64-linux-gnu/libtk8.5.so.0 /usr/lib/libtk8.5.so.0
sudo ln -s /usr/lib/x86_64-linux-gnu/tcl8.5/tclConfig.sh /usr/lib/tclConfig.sh
sudo ln -s /usr/lib/x86_64-linux-gnu/tk8.5/tkConfig.sh /usr/lib/tkConfig.sh
RUBY_CONFIGURE_OPTS="--with-tcl-include=/usr/include/tcl8.5
--with-tcllib=tcl8.5 --with-tklib=tk8.5 --with-tcltkversion=8.5
--with-tk-include=/usr/include/tcl8.5
--with-tclConfig-file=/usr/lib/tclConfig.sh
#!/bin/bash
PHANTOM_JS="phantomjs-1.9.8-linux-x86_64"
if [[ $EUID -ne 0 ]]; then
echo "You must be a root user" 2>&1
exit 1
else
apt-get update
apt-get install -y build-essential chrpath libssl-dev libxft-dev
apt-get install -y libfreetype6 libfreetype6-dev
apt-get install -y libfontconfig1 libfontconfig1-dev
@prusswan
prusswan / Gemfile
Last active September 3, 2015 04:14 — forked from eritiro/Gemfile
Working Gemfile for rails 5 app (alpha version)
source 'https://rubygems.org'
ruby '2.2.3'
gem 'rails', github: "rails/rails"
gem 'sprockets-rails', github: 'rails/sprockets-rails'
gem 'sprockets', github: "rails/sprockets"
gem 'sass-rails', github: "rails/sass-rails"
gem 'arel', github: "rails/arel"
gem 'rack', github: "rack/rack"
@prusswan
prusswan / gist:79789c6d9affa889e2ac
Created October 6, 2015 06:05 — forked from schacon/gist:942899
delete all remote branches that have already been merged into master
$ git branch -r --merged |
grep origin |
grep -v '>' |
grep -v master |
xargs -L1 |
awk '{split($0,a,"/"); print a[2]}' |
xargs -I% git push v2 :%
@prusswan
prusswan / zaobao10.html
Created April 12, 2016 09:52 — forked from kyroskoh/zaobao10.html
ZaoBao 10 (CartoDB)
<!DOCTYPE html>
<html>
<head>
<title>ZaoBao OneMap</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=yes" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<link rel="shortcut icon" href="http://cartodb.com/assets/favicon.ico" />
<!-- Include CSS -->
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" />
@prusswan
prusswan / gist:3a1617076b15ecb407e7b4d59263d412
Created May 11, 2016 15:28 — forked from yifanlu/gist:e80db121d38aceb8cca0e03cefd5853b
3DS System Transfer + NNID & eShop on new region
This is an ADVANCED guide and should not be attempted by anyone who does not COMPLETELY understand each step and what it does to their device. Additionally, the prerequisite is that you have already performed a region change on your 3DS. You also need access to another 3DS on the target region that you can format to a non-NNID linked state (you can use emuNAND here). For simplicity, I am going to assume you are region changing a N3DS from Japan to USA and have access to a USD O3DS. The guide is in two parts: System Transfer and NNID Linking. For those who wish to just have access to USA eShop (and the ability to download free games; if you only want to use eShop to purchase games, you do not have to link a NNID) you can skip to the second part.
To modify requests, I use Charles Proxy to set breakpoints so I can change requests and responses as they come in. However, you can do it in any why you choose. Also, since 9.2 eShop was disabled, you may have to additionally modify all requests from the 3DS to send a
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@prusswan
prusswan / delete_git_submodule.md
Created July 6, 2018 08:49 — forked from myusuf3/delete_git_submodule.md
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule