Skip to content

Instantly share code, notes, and snippets.

func randRune() rune {
var newRune rune
for {
newRune = rune(randGen.Uint32())
if utf8.ValidRune(newRune) {
return newRune
}
}
}
@mythril
mythril / gist:5789515
Created June 15, 2013 20:36
hyper trivial mod_rewrite rules
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php [L]
@mythril
mythril / weinred.sh
Last active December 18, 2015 10:39
weinre init.d script
#!/bin/bash
### BEGIN INIT INFO
# Provides: weinre
# Required-Start: $remote_fs $syslog networking
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: weinre mobile debugger
# Description: Provides remote front-end debugger for mobile user agents
# like Chrome Inspector or FireBug
@mythril
mythril / jquery.flot.js
Created May 24, 2013 20:37
breaks jshint
/* Javascript plotting library for jQuery, version 0.8.0.
Copyright (c) 2007-2013 IOLA and Ole Laursen.
Licensed under the MIT license.
*/
// first an inline dependency, jquery.colorhelpers.js, we inline it here
// for convenience
<ruleset name="name-of-your-coding-standard">
<description>Description of your coding standard</description>
<rule ref="Generic.PHP.DisallowShortOpenTag"/>
<!-- ... -->
</ruleset>
@mythril
mythril / gist:5587588
Created May 15, 2013 21:33
Build log
Started by user anonymous
Building in workspace /var/lib/jenkins/jobs/viper/workspace
Checkout:workspace / /var/lib/jenkins/jobs/viper/workspace - hudson.remoting.LocalChannel@4922c082
Using strategy: Default
Last Built Revision: Revision 1d0ee1d8ebf059b1e3a42ebeb49c7a7d135b7f0c (origin/master, origin/HEAD)
Fetching changes from 1 remote Git repository
Fetching upstream changes from origin
Seen branch in repository origin/HEAD
Seen branch in repository origin/master
Seen 2 remote branches
@mythril
mythril / jenkins-php.md
Last active December 17, 2015 09:18
Setting up Jenkins for PHP / Git

Install basic required stack (on top of Debian GNU/Linux 7.0 (wheezy) netboot)

including: pear, ant, a JDK & JRE, git, sudo, php5 command line, curl

su
apt-get install php5-cli git sudo default-jre-headless php-pear ant \
	openjdk-6-jdk curl libapache2-mod-php5
usermod -a -G sudo <user>
exit
[sudo] password for luke:
Sorry, try again.
[sudo] password for luke:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
pwgen
0 upgraded, 1 newly installed, 0 to remove and 4 not upgraded.
Need to get 21.7kB of archives.
user@user-battlestation ~/go/src/github.com/user/mersenne $ go env
warning: GOPATH set to GOROOT (/home/user/go/) has no effect
GOARCH="amd64"
GOBIN=""
GOCHAR="6"
GOEXE=""
GOGCCFLAGS="-g -O2 -fPIC -m64 -pthread"
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
@mythril
mythril / index.html
Created December 1, 2012 18:18
A CodePen by Anonymous.
<ul>
<a href=""><li>Body Treatments</li></a>
<a href=""><li>Make Up</li></a>
<a href=""><li>Skincare</li></a>
<a href=""><li>Hand & Feet Treats</li></a>
</ul>