Skip to content

Instantly share code, notes, and snippets.

View WesleyE's full-sized avatar

Wesley Elfring WesleyE

View GitHub Profile
@WesleyE
WesleyE / HysteresisController.js
Created January 22, 2020 15:59
HysteresisController
class HysteresisController {
/**
*
* @param {Object} options Options array
* @param {Function} onChange Function to call when the state should change
*/
constructor(options, onChange) {
this.targetTemperature = options.targetTemperature;
this.min = options.min;
@WesleyE
WesleyE / download.js
Created December 9, 2019 12:35
Download ArcGis Features from Server
var fs = require('fs');
const https = require('https');
var offset = 0;
var rowsPerFetch = 2000;
var totalRows = 459701;
var fetches = Math.ceil(totalRows / rowsPerFetch);
var offsetIterator = 0;
function getDownloadUrl(offset) {

Keybase proof

I hereby claim:

  • I am WesleyE on github.
  • I am wesleye (https://keybase.io/wesleye) on keybase.
  • I have a public key whose fingerprint is 2A9B C330 A7C8 D507 FECE 415D F7C0 E5BE E55E 6EBC

To claim this, I am signing this object:

@WesleyE
WesleyE / ping.py
Created June 13, 2016 12:10 — forked from pklaus/ping.py
A pure python ping implementation using raw socket.
#!/usr/bin/env python2
"""
Other Repositories of python-ping
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* https://github.com/l4m3rx/python-ping supports Python2 and Python3
* https://bitbucket.org/delroth/python-ping
@WesleyE
WesleyE / listen.php
Last active February 2, 2016 12:57
Listen to all queries on a Capsule
$capsule->getDatabaseManager()->connection()->listen(
function ($query) {
// Fix bindings
$sql = $query->sql;
foreach ($query->bindings as $binding) {
//Find first occurence and replace
$sql = preg_replace('/\?+/', $binding, $sql, 1);
}
@WesleyE
WesleyE / extract.bat
Created August 22, 2015 20:15
A good few years ago, this was my quick way of stitching an video with PTGUI and Hugin. Requires Hugin, a project file for one of the frames and FFMPEG.
ffmpeg -i GOPR0011.MP4 -f image2 GOPR0011/GOPR0011_%3d.jpg
ffmpeg -i GOPR0012.MP4 -f image2 GOPR0012/GOPR0012_%3d.jpg
ffmpeg -i GOPR0015.MP4 -f image2 GOPR0015/GOPR0015_%3d.jpg
ffmpeg -i GOPR2943.MP4 -f image2 GOPR2943/GOPR2943_%3d.jpg
ffmpeg -i GOPR8717.MP4 -f image2 GOPR8717/GOPR8717_%3d.jpg
pause
"""Houdini Import Script - Work In Progress
Check http://scripts.wesleyelfring.nl/minecraft-import-script-for-houdini/
"""
import hou,os,sys
# Check for the required modules, we need pyyaml and pymclevel in the $JOB/scripts/ folder.
job = hou.expandString('$JOB')
sys.path.insert(0, os.path.join(job, "scripts", "pymclevel"))
sys.path.insert(0, os.path.join(job, "scripts"))
@WesleyE
WesleyE / nukeTranscode.py
Created June 30, 2015 19:51
Transcode a folder of images using Nuke
"""
The MIT License (MIT)
Copyright (c) 2014 Wesley Elfring
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@WesleyE
WesleyE / MoveExporter.py
Created June 30, 2015 19:43
Hiero move exporter, moves files between folders instead of coping
"""
The MIT License (MIT)
Copyright (c) 2014 Wesley Elfring
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@WesleyE
WesleyE / Maya_BatchRenderer_V2_0_1.py
Created June 30, 2015 15:02
This script allows you to quickly create a batch render from multiple camera's and multiple ranges in Maya.
# -*- coding: utf-8 -*-
"""
The MIT License (MIT)
Copyright (c) 2014 Wesley Elfring
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell