Skip to content

Instantly share code, notes, and snippets.

View robinvanemden's full-sized avatar
🌳
⏩ ⏩

Robin van Emden robinvanemden

🌳
⏩ ⏩
View GitHub Profile
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))
# Make sure you grab the latest version
curl -OL https://github.com/google/protobuf/releases/download/v3.5.1/protoc-3.5.1-linux-x86_64.zip
# Unzip
unzip protoc-3.5.1-linux-x86_64.zip -d protoc3
# Move protoc to /usr/local/bin/
sudo mv protoc3/bin/* /usr/local/bin/
# Move protoc3/include to /usr/local/include/
@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;
@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
@alexdevero
alexdevero / markdown.reg
Last active January 3, 2024 08:48
Add markdown as an item to “New” context menu in Windows 10 (https://superuser.com/questions/638755/add-item-to-new-context-menu-in-windows-8#640486).
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\.md]
@="markdown"
[HKEY_CLASSES_ROOT\.md\ShellNew]
"NullFile"=""
[HKEY_CLASSES_ROOT\markdown]
@="Blank Markdown file"
@odashi
odashi / cudnn_convolution_forward.cu
Created January 8, 2018 15:40
Example usage of cuDNN convolution forward functions.
#include <iomanip>
#include <iostream>
#include <cstdlib>
#include <vector>
#include <cuda.h>
#include <cudnn.h>
#define CUDA_CALL(f) { \
cudaError_t err = (f); \
@jahe
jahe / rest-api-cheatsheet.md
Last active April 12, 2022 06:30
REST API Cheatsheet

REST API Cheatsheet

Source: https://www.youtube.com/watch?v=5WXYw4J4QOU

  • POST, GET, PUT, DELETE != CRUD
  • no verbs -> just nouns for Resources: /applications or /applications/123
  • Possible Responses: Collection of Resources (e.g. with Links) or One instance of a Resource
  • Keep your API course grained to be scaleble to future requirements
  • For Resources: Be as specific as possible: /customers vs. /newsletter-customers and /registered-customers
  • PUT for Create: Can be used when the Client has the ability to create an identifier for the Resource himself. But it has to contain a full replacement of the dataset: PUT /applications/123
@goldsborough
goldsborough / conv.cu
Last active November 27, 2023 05:59
Convolution with cuDNN
#include <cudnn.h>
#include <cassert>
#include <cstdlib>
#include <iostream>
#include <opencv2/opencv.hpp>
#define checkCUDNN(expression) \
{ \
cudnnStatus_t status = (expression); \
if (status != CUDNN_STATUS_SUCCESS) { \
<?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!');
}
@matthewjberger
matthewjberger / notes.md
Last active March 11, 2024 10:21
How to make an electron app using Create-React-App and Electron with Electron-Builder.