Skip to content

Instantly share code, notes, and snippets.

View markijbema's full-sized avatar

Mark IJbema markijbema

  • Cogitans
  • Groningen, Netherlands
View GitHub Profile
@markijbema
markijbema / clone-heroku-app
Created March 22, 2023 11:10 — forked from pcreux/clone-heroku-app
Script to clone a heroku app (including buildpacks, users, add-ons, environment variables, lab features)
#!/usr/bin/env ruby
# Copy a heroku app (buildpacks, add-ons, labs, config, users).
# This script is idempotent so it can run against an existing app.
#
# Usage:
# $> clone-heroku-app source-app target-app
require 'json'
@markijbema
markijbema / test
Created January 30, 2019 12:54
test
<html>
<title>yolo</title>
<iframe src="javascript:alert(`xss`)">
@markijbema
markijbema / gist:11230754
Created April 23, 2014 20:16
PhantomJS compatible Function.bind polyfill
// Source: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind
// changed line 14. In the original version, it broke PhantomJS, now it works
// This probably means this doesn't support some weird corner case, or we broke an optimization.
if (!Function.prototype.bind) {
Function.prototype.bind = function (oThis) {
if (typeof this !== "function") {
// closest thing possible to the ECMAScript 5 internal IsCallable function
throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");
@markijbema
markijbema / gist:9638000
Created March 19, 2014 09:00
Automatically renew facebook
FactlinkApp.module "FacebookRenewal", (FacebookRenewal, FactlinkApp, Backbone, Marionette, $, _) ->
if Factlink.Global.environment == 'test'
renewal_url = "about:blank"
else
renewal_url = "/auth/facebook"
class IframeView extends Backbone.Marionette.ItemView
template:
text: """
@markijbema
markijbema / henk.rb
Created August 13, 2013 22:02
RubyWarrior with fibers
Thread::abort_on_exception = true
class Henk
def run
while true
walk!
attack!
recover!
end
end
#!/usr/bin/php
<?php
function getFibonacci()
{
$k = 0;
while(true){
$k++;
$a = (yield $k);
echo "yo" . $a . "\n";
}
@markijbema
markijbema / gist:5668813
Created May 29, 2013 08:35
SublimeText user preferences
{
"detect_indentation": false,
"detect_slow_plugins": false,
"ensure_newline_at_eof_on_save": true,
"font_size": 16.0,
"ignored_packages":
[
"Vintage"
],
"tab_size": 2,