Skip to content

Instantly share code, notes, and snippets.

View scambier's full-sized avatar

Simon Cambier scambier

View GitHub Profile

NeedL bot script, circa ~2005

For archive purposes

@scambier
scambier / userscriptTwitterMediaDownload.js
Created May 5, 2019 08:09
Userscript: Twitter Media Download
// ==UserScript==
// @name Twitter Video Download
// @namespace http://scambier.github.io/
// @version 0.1
// @description Adds an "Open video" link for tweets whith an embedded video
// @author Simon Cambier
// @match https://twitter.com/*
// @grant none
// @run-at document-idle
// ==/UserScript==
@scambier
scambier / signalr.service.ts
Last active April 5, 2019 11:46
VueJS service for SignalR
import { HubConnectionBuilder, LogLevel } from '@aspnet/signalr'
async function wait(ms: number) {
return new Promise(resolve => {
setTimeout(resolve, ms)
})
}
const hubUrl = 'https://localhost:44360/testHub'
@scambier
scambier / pyGitDiff.py
Created March 19, 2019 12:41
Copy all changed files between two git commits. Respects the folders structure.
#! /usr/bin/python
# Usage: python pyGitDiff.py hash1 hash2
# Help: python pyGitDiff.py -h
import subprocess
import os
import shutil
from datetime import datetime
import argparse
ignoreList = [".gitignore"]
@scambier
scambier / init.lua
Last active February 26, 2016 22:05
shaders' class from mari0 updated for LÖVE 0.10.0
-- Licence: https://creativecommons.org/licenses/by-nc-sa/3.0/
-- This is the shaders/init.lua file from mari0, updated for 0.10.0
-- Original authors: Stabyourself.net - Maurice Guégan and Sašo Smolej
local supported = love.graphics.getSupported and love.graphics.getSupported("canvas") and love.graphics.getSupported("pixeleffect")
local supports_npo2 = love.graphics.getSupported and love.graphics.getSupported("npot") or false -- on the safe side
if not supported then
shaderssupported = false
print("post-processing shaders not supported")
end
@scambier
scambier / waitforseconds.lua
Last active August 29, 2015 14:21
waitForSeconds Lua function equivalent to "new WaitForSeconds()" from Unity
-- Heavily inspired by http://www.mohiji.org/2012/12/14/lua-coroutines/
require 'socket'
local WAITING_COROUTINES = {}
function waitForSeconds(seconds)
local milli = seconds * 1000
local co = coroutine.running()
assert(co ~= nil, "Cannot wait on main thread")
local wakeuptime = socket.gettime() * 1000 + milli