Skip to content

Instantly share code, notes, and snippets.

View hendrikswan's full-sized avatar

hendrik swanepoel hendrikswan

View GitHub Profile
@hendrikswan
hendrikswan / .gitignore
Created October 12, 2011 19:20
sync-putio-files
credentials.txt
series_sort.py
*.pyc
@hendrikswan
hendrikswan / example.html
Created November 14, 2011 09:21
static-tabs
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Demo of static tabs</title>
<link type="text/css" href="css/ui-lightness/jquery-ui-1.8.10.custom.css" rel="stylesheet" />
<script type="text/javascript" src="js/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.8.10.custom.min.js"></script>
<script type="text/javascript" src="js/jquery-staticTabs.js"></script>
<script type="text/javascript">
@hendrikswan
hendrikswan / app.rb
Created December 20, 2011 21:29
sample sinatra mongodb service
require 'sinatra'
require 'mongoid'
require 'json'
require "sinatra/reloader" if development?
Mongoid.load!("mongoid.yml")
class Price
include Mongoid::Document
@hendrikswan
hendrikswan / private.xml
Created July 23, 2015 07:40
karabiner config for using OSX shortcuts in Virtualbox windows guest
<?xml version="1.0"?>
<root>
<item>
<name>Virtualbox</name>
<identifier>private.test</identifier>
<only>VIRTUALMACHINE</only>
<autogen>__KeyToKey__ KeyCode::Z, VK_COMMAND, KeyCode::Z, VK_CONTROL</autogen>
<autogen>__KeyToKey__ KeyCode::S, VK_COMMAND, KeyCode::S, VK_CONTROL</autogen>
<autogen>__KeyToKey__ KeyCode::X, VK_COMMAND, KeyCode::X, VK_CONTROL</autogen>
<autogen>__KeyToKey__ KeyCode::C, VK_COMMAND, KeyCode::C, VK_CONTROL</autogen>
{
"name": "react-stack",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
@hendrikswan
hendrikswan / .eslintrc
Last active September 29, 2020 09:18
Packages and build config for Build Cross Platform React Native Apps with Exponent and Redux
{
"extends": "airbnb/base",
"plugins": [
"react"
],
"env": {
"node": true,
"jasmine": true,
},
"rules": {
@hendrikswan
hendrikswan / promise-tied-to-event.js
Created June 14, 2017 18:11
code samples for medium post
function syncMouseEvent(event) {
api.syncEvent({
x: event.clientX,
y: event.clientY
})
.then((result) => {
console.log('successfully synced a mouse event');
})
.catch((reason) => {
console.error('got an error while trying to sync an event')
var promise = Promise.resolve(new Date());
promise.then((date) => console.log(date));
setTimeout(() => promise.then((date) => console.log(date)), 2000);
// OUTPUT
// 2017–06–14T17:55:43.322Z
// 2017–06–14T17:55:43.322Z
const pendingItems = new Rx.Subject();
pendingItems.subscribe((item) => {
api.syncEvent(item)
.then((result) => {
console.log('successfully synced a mouse event');
})
.catch((reason) => {
console.error('got an error while trying to sync an event')
});
const pendingItems = new Rx.Subject();
pendingItems.subscribe((item) => {
api.syncEvent(item)
.then((result) => {
console.log('successfully synced a mouse event');
})
.catch((reason) => {
console.error('got an error while trying to sync an event, going to try again');
pendingItems.next(item);