Skip to content

Instantly share code, notes, and snippets.

View robinvanemden's full-sized avatar
🌳
⏩ ⏩

Robin van Emden robinvanemden

🌳
⏩ ⏩
View GitHub Profile
@nevergone
nevergone / D5-SA-CORE-2018-004.patch
Last active April 29, 2018 14:25
D5-SA-CORE-2018-004.patch (SA-CORE-2018-002 fix included)
diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc
index 5b2e5ab..3d93104 100644
--- a/includes/bootstrap.inc
+++ b/includes/bootstrap.inc
@@ -911,6 +911,7 @@ function _drupal_bootstrap($phase) {
drupal_unset_globals();
// Initialize the configuration
conf_init();
+ _drupal_bootstrap_sanitize_request();
break;
@afelicioni
afelicioni / meh.sh
Created February 28, 2016 13:03
Setup Zmodem rz sz commands on Ubuntu
apt-get install lrzsz
library(contextual)
library(data.table)
library(animation)
## 1. Bandit Simulation ---------------------------------------------------------------------------
# Run a simulation that saves the policy's theta values
policy <- EpsilonGreedyPolicy$new(epsilon = 0.1)
bandit <- BasicBernoulliBandit$new(weights = c(0.4, 0.5, 0.3))
@robinvanemden
robinvanemden / jquery.couch.longpoll.js
Created November 5, 2016 16:38 — forked from schinckel/jquery.couch.longpoll.js
Long-polling handler for CouchDB
/*
# jquery.couch.longpoll.js #
A handler that can be used to listen to changes from a CouchDB database,
using long-polling.
This seemed to be a bit simpler than using continuous polling, which I
was unable to get working with jQuery.
<?php
// Webhook code to update repo clone and execute required deployement code when new commit was pushed
// Webhook content-type should be set to application/json and a random secret code should be set too.
// Secret Random Code You set on github webhook settings
const SECRET_TOKEN = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
if(strcasecmp($_SERVER['REQUEST_METHOD'], 'POST') != 0){
throw new Exception('Request method must be POST!');
}
@bushidocodes
bushidocodes / wasm-summit-2020-notes.md
Last active July 30, 2020 23:47
WebAssembly Summit 2020 Notes

WebAssembly Summit 2020

https://webassembly-summit.org/

Lin Clark's Talk - "WebAssembly Nanoprocess"

https://www.youtube.com/watch?v=IBZFJzGnBoU

  • the missing functionality alongside WASI and Interface Types is something that provides "capability-based security".
  • Delegation of permissions to propagate down transitive dependencies
  • plan to use fine-grain form of per-module virtualization
  • A "WebAssembly nanoprocess" is just wasm, but follows a particular pattern.
@keeferrourke
keeferrourke / Makefile
Last active November 20, 2020 21:49
Generic Makefile
# Generic makefile for a C project
# Written by Keefer Rourke <mail@krourke.org>
#
# This file is Public Domain or, in places where public domain works
# are not recognized, licensed as CC0. Legal text:
# <https://creativecommons.org/publicdomain/zero/1.0/legalcode.txt>
#
# This Makefile should not rely and any GNU-specific functionality,
# though it is based on the GNU make documentation which is available
# at: <https://www.gnu.org/software/make/manual/make.html>
@andrew-d
andrew-d / nix2-arm-build.sh
Last active February 10, 2021 11:53
Helpful script to build a copy of Nix 2.0 for ARM (arm-linux-gnueabihf)
#!/bin/bash
# USAGE: docker run -t -i --rm -v $PWD:/out ubuntu:16.04 /out/build.sh
set -eu
# Install
install_packages() {
apt-get update && apt-get upgrade -yy
/* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/*
* Copyright 2011 Couchbase, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
@leiless
leiless / postman-echo.c
Created August 12, 2019 14:22
[Test] Simple program to POST a HTTP request to postman-echo.com
/**
* Simple program to POST a HTTP request
*
* see:
* https://docs.postman-echo.com/?version=latest
* https://aticleworld.com/http-get-and-post-methods-example-in-c/
* https://stackoverflow.com/questions/11208299/how-to-make-an-http-get-request-in-c-without-libcurl
* https://stackoverflow.com/questions/22077802/simple-c-example-of-doing-an-http-post-and-consuming-the-response
*/