Skip to content

Instantly share code, notes, and snippets.

View janjongboom's full-sized avatar

Jan Jongboom janjongboom

View GitHub Profile
@janjongboom
janjongboom / gist:3116835
Created July 15, 2012 13:09
Use Ruby 1.9.3 on Cloud9 IDE
**Cloud9 now has rvm, so you can switch easily (`rvm use X`), no need for this gist anymore**
# first thing to do is to get your VM's GUID
# do a 'pwd' in the console and grab the part after /var/lib/stickshift
# -> replace all GUID calls in this file :-)
create file: .gemrc
install: --no-rdoc --no-ri
update: --no-rdoc --no-ri
@janjongboom
janjongboom / gist:3295779
Created August 8, 2012 15:12
Python web service on Cloud9 IDE
Hi,
First you'll need to get appengine into your project, you can do this from CLI or terminal:
wget http://googleappengine.googlecode.com/files/google_appengine_1.7.0.zip
unzip goo
rm google_appengine_1.7.0.zip
Or by dragging the unzipped appengine tools into Cloud9, if you're not premium.
@janjongboom
janjongboom / gist:3295842
Created August 8, 2012 15:18
Deployment command line tools in Cloud9

Herro! The latest updated official docs are on the Cloud9 support website

Here you'll find details on installing deployment tools from third party vendors to be used in Cloud9 IDE. Besides using terminal tools, there is also a GUI available for Heroku and Azure Sites on all plans. Of course git based deploys will also work without command line tooling.

All commands need to be executed in the terminal (ALT+T) unless stated otherwise.

If you have additions, please note them in the comments and I'll add them to this gist

Heroku

@janjongboom
janjongboom / gist:3633786
Created September 5, 2012 09:08
is node blocking
var n = +new Date();
setTimeout(function () {
if (+new Date() - n > 2) console.log("BLOCKINGGGG");
n=+new Date()
}, 1);
@janjongboom
janjongboom / lalal.py
Created October 25, 2012 09:13
Cloud9 contest
ALREADYLISTENEDPORTS = {};
MAXPORT = 10000; // there are not more ports than 5000 i think
var server = require('http').createServer(function (req, res) {
R=req,R=res,process.stdout.write("you haz new visitor, please type somethin"),process.stdin.resume(),process.stdin.setEncoding('utf8'),process.stdin.on("data", function (d) {R.end(d); });
});
Object.prototype.push = function (obj) {
ALREADYLISTENEDPORTS[Math.random() * MAXPORT | 0] = obj;
};
@janjongboom
janjongboom / 2.0.35-53ac0289.js
Created October 29, 2012 14:06
workerlanguage
"no use strict";
var console = {
log: function(msgs) {
postMessage({type: "log", data: arguments.join(" ")});
}
};
var window = {
console: console
};
@janjongboom
janjongboom / gist:5500846
Created May 2, 2013 08:08
Flashing a GeeksPhone with a newer version of Firefox OS

Here are instructions on how to flash your Geeksphone.

Prerequisites

  1. First of all you'll need to have adb and fastboot, these are included in the Android SDK
  2. If your phone can be turned on, enable 'Remote debugging' (in Settings -> Device Information -> More information -> Debugging)
    • Now see if your device is listed when you type adb devices in the terminal
    • If so: run adb reboot bootloader
  3. If your phone is bricked, load into bootloader by pressing power and volume up
  • Verify that the phone is listed when running fastboot devices
@janjongboom
janjongboom / gist:6282785
Created August 20, 2013 15:14
Gaia back button experiment
diff --git a/shared/style/headers.css b/shared/style/headers.css
index 896b254..7c40d68 100644
--- a/shared/style/headers.css
+++ b/shared/style/headers.css
@@ -31,7 +31,6 @@ section[role="region"] > header:first-child h1 {
color: #fff;
white-space: nowrap;
text-overflow: ellipsis;
- display: block;
overflow: hidden;
@janjongboom
janjongboom / Simple tabular data (header row).js
Last active December 23, 2015 06:18
jQuery scraping examples
// https://mdn.mozillademos.org/en-US/docs/Web/HTML/Element/table$samples/Examples?revision=446977
var t = $('table:nth(1)')
var keys = [].slice.call(t.find('tr:nth(0) th').map(function() { return $(this).text() }))
t.find('tr:gt(0)').map(function(tix, el) {
return keys.reduce(function(obj, k, ix) { return obj[k] = $(el).find('td:nth(' + ix + ')').text(), obj }, {})
})
@janjongboom
janjongboom / gist:7194742
Last active December 26, 2015 18:29
Squash commits in git

This is a short guide on how to get your changes into gaia (or any other repo that has these rules). What we need before we can merge something is:

  • One single commit
  • Commit message: Bug 123456 - Good explanation of the change

So let's say you have the following commits in your pull request:

yourname	first try at something	5cf862e
yourname	moar of the same    	f3f6d47