Skip to content

Instantly share code, notes, and snippets.

View emileber's full-sized avatar
🗜️
Minimizing...

Emile J. Bergeron emileber

🗜️
Minimizing...
View GitHub Profile
@emileber
emileber / typescript.ts
Last active March 14, 2024 18:28
TypeScript helpers
/**
* @see https://www.typescriptlang.org/play?#code/C4TwDgpgBAkgZgUQI4FcCGAbAzgHgIIA0UAQkQCoBOKERAYplhAHxQC8UAFDmUxwJRsWZKBAAewCADsAJlih4AUFCgB+KAEYlUAFxQATALESZc7rwGshI8VNklVGnfq1rK1LbvrYIAbgULQSCgAdQoAS2A0ACMMCABpCBBcHjYoAG8tAG0ABSgwySgAa0SAezgoMgBdXXhkdGwcLWU0zIBFPILs6oq2yoBfAib0gFoKCDRpEskMECg2jqgu3TJegaHsweVlSQgANwgKLSY-PszikDKKyr8A8GhQiOjYs1TssIBjQu4iB8iY+MSySYx38gWg2XCAFsImF9gA1TDUVJYYDhSQAcygAB8oJIUJCogdsVAoiUSrE0AUcSgZBA4PkINJiXiMBgbmDFlCYfsEkkXuwMspMnEFudLlVlsLKtZjHYIWFocBYRAERgkWoRbodvsKCczqVylV2XdOQruRB+YsPl8yER5YrlbygSDbkEElFoo1lMIjLY5Ci0ejNvIZX6oAH8pj2AByaODFjsH02ExQAAGABI0vk4ETaH1M9miQAlPqplxQd2eotEDNpPD5tK0UMpgAyJQA7gd3mhGDhaCw1LGnNHhtGG23OxRu73+6WmB55DdXdBK1EnZbBXMRfkigaKlAexXm3YIxiHKucHEWLo4t0VreTsagkWIJCSvsYLTRBustuCmLDQPf1UUjY85DiIY1G1A4hi1fFCQoMCK0g3E9hgrYnCwEACXJJCIIwqC0MODCbzvKVH38AB6Sjhlouj6IYxjhlBE0AGUShQKdoAFLQxgmKYZigWIMWAAALOCCQOPxlDgMldFPdFpJJNAKF0fhBCgXYSjCaQlPyRhgE-DAGVYyIKGAeSQIxJSAC9P2kMRLMDJTMjCCSEO6BSKOXCoVPRCBgFSF83w-L9LwgD010BHB7XNHBfieC12M495mGBEFqK2AA9FQWKCAAJYBIQwUyQF
@emileber
emileber / test-globals.es5.js
Last active February 18, 2019 16:33
Check for globals added by other scripts after the page is loaded.
/**
* Check for globals added by other scripts after the page is loaded.
* Place this at the top of `<head>`.
*
* Uses `getOwnPropertyNames` to get the non-enumerable properties as well.
*/
(function(getGlobalKeys) {
var keys = getGlobalKeys();
window.addEventListener("load", function() {

Keybase proof

I hereby claim:

  • I am emileber on github.
  • I am emileber (https://keybase.io/emileber) on keybase.
  • I have a public key whose fingerprint is 3BC4 E985 1853 C909 CBEA B673 4681 050C A33D 3ED9

To claim this, I am signing this object:

@emileber
emileber / infinite-collection.js
Last active September 22, 2016 20:31
Backbone infinite scroll collection inspired by Backbone.paginator
var InfiniteCollection = Backbone.Collection.extend({
state: {
pageSize: 5, // default value for a page
},
queryParams: {
pageSize: "limit",
pagesLeft: null,
total: null,
@emileber
emileber / gitupdate.bat
Last active September 13, 2015 21:06
Creates a zip archive named `YYY-MM-DD_update.zip` including only changed files using git from specified commit-id relative to the current directory.
@echo off
setlocal enabledelayedexpansion
git diff --name-only --relative %1^^
set SAVESTAMP=%DATE:/=-%
set output=
for /f "delims=" %%a in ('git diff --name-only --relative %1^^') do ( set output=!output! "%%a" )
git archive -o %SAVESTAMP%_update.zip HEAD %output%
endlocal
@emileber
emileber / Resource.cpp
Last active January 24, 2017 19:36
Resources or assets manager template in C++. Uses a Singleton pattern template as well, which I'm not fond of, but works really well in this particular case. Feel free to use it in your own personal or commercial code. The whole lib is available at https://github.com/PrismalStudio/PrismalUtils
/**
* @file Resource.cpp
* @brief Implementation of Resource methods. Mainly getters/setters.
* @author E. Bergeron
* @date 2012-02-13
* @copyright Prismal Studio 2008-2013 www.prismalstudio.com
*/
#include "Resource.h"