Skip to content

Instantly share code, notes, and snippets.

View fatso83's full-sized avatar
🐢
Two toddlers. Very little time for OSS after work hours. File a PR!

Carl-Erik Kopseng fatso83

🐢
Two toddlers. Very little time for OSS after work hours. File a PR!
View GitHub Profile
@fatso83
fatso83 / redis connection output.txt
Last active September 16, 2015 17:16
Shows how Redis is behaving when disconnecting and connecting
7 'connected'
5007 'getting key'
5881 'ended'
5882 'reconnecting' { delay: 255, attempt: 2 }
6143 'error' [Error: Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED]
6144 'reconnecting' { delay: 433, attempt: 3 }
6580 'error' [Error: Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED]
6580 'reconnecting' { delay: 736, attempt: 4 }
7319 'error' [Error: Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED]
7319 'reconnecting' { delay: 1251, attempt: 5 }
@fatso83
fatso83 / ycm-cygwin.patch
Created December 9, 2015 00:44
Patch to make YCM compile on Cygwin See ycm-core/YouCompleteMe#833
diff --git a/cpp/BoostParts/boost/python/detail/wrap_python.hpp b/cpp/BoostParts/boost/python/detail/wrap_python.hpp
index eaef784..6b367ce 100644
--- a/cpp/BoostParts/boost/python/detail/wrap_python.hpp
+++ b/cpp/BoostParts/boost/python/detail/wrap_python.hpp
@@ -82,7 +82,7 @@
// Some things we need in order to get Python.h to work with compilers other
// than MSVC on Win32
//
-#if defined(_WIN32) || defined(__CYGWIN__)
+#if defined(_WIN32)
@fatso83
fatso83 / app.js
Last active December 31, 2015 07:29
This feature detects the actual event name used by the browser for transitionEnd . This might differ from Modernizr.prefixed('transition'). Known browsers+device affected by this: Chrome 27.0.1453.93 on Desktop/OS X, Android 4.1.2 browser running on Samsung Note II
// Defines prefixed versions of the
// transitionEnd event handler
transitionFinishedEvents = {
'WebkitTransition' : 'webkitTransitionEnd',
'MozTransition' : 'transitionend',
'OTransition' : 'oTransitionEnd',
'msTransition' : 'msTransitionEnd',
'transition' : 'transitionEnd'
};
// Define the correct transition event for this UA
@fatso83
fatso83 / gist:88370e1d75de2b9ba00b
Created March 9, 2015 16:08
Gulp config for babelify
var gulp = require('gulp');
var source = require('vinyl-source-stream'); // Used to stream bundle for further handling
var browserify = require('browserify');
var watchify = require('watchify');
var gulpif = require('gulp-if');
var uglify = require('gulp-uglify');
var streamify = require('gulp-streamify');
var notify = require('gulp-notify');
var concat = require('gulp-concat');
var cssmin = require('gulp-cssmin');
@fatso83
fatso83 / vector_map.js
Created April 24, 2016 19:01
Browserified vector map giving me headaches when bundled in ASP.NET
(function e(t, n, r) {
function s(o, u) {
if (!n[o]) {
if (!t[o]) {
var a = typeof require == "function" && require;
if (!u && a) return a(o, !0);
if (i) return i(o, !0);
var f = new Error("Cannot find module '" + o + "'");
throw f.code = "MODULE_NOT_FOUND", f
}
#!/bin/bash
# Utility to force your mac immediately into hibernation mode/suspend to disk,
# thus conserving battery considerably (at the cost of slower startup)
# @date 2012-02-10
# @author Carl-Erik Kopseng. Contact at oligofren.wordpress.com
# must be run as root by using sudo or to avoid entering the password, change the pmset
# executable settings by entering
# sudo chmod +s /usr/bin/pmset
@fatso83
fatso83 / transition-end-feature-detect.js
Created June 20, 2016 17:25
Feature detect the actual transition end event used in the current browser. Needed for some buggy Samsung devices
// globals: window, document, $
//
// Feature detect the actual transitionFinished event
// used by the current browser
//
// Used like this:
// var features = {};
// transitionEndFeatureDetection((eventName) => {
// features.transitionFinishedEvent = eventName;
// });
@fatso83
fatso83 / Full restart of IIS
Created June 21, 2016 12:52
How to fully stop the IIS and the Web Application System to be able to clear caches and stuff
# It should be run with admin rights. Rerun if it fails.
net stop was
# do your thing: run deploy script, whatever
# iis no longer holds on to any files
# to clear the cache of compiled cshtml templates matching "preview" I did this
# `find /cygdrive/c/Windows/Microsoft.NET/Framework64/v4.0.30319/ -iname '*campaign*' -print0|xargs -0 rm`
net start w3svc
@fatso83
fatso83 / test-script.sh
Last active July 28, 2016 18:43
Test script for sinonjs/sinon#1113. Place it one level above the project and run `sh ../test-script.sh` to test it
#!/bin/bash
# test script built for use with `git bisect` to find a regression
# usage: git bisect start v1.16.1 v1.15.4 && git bisect run ../test-script.sh
#
# Warning: You need a Node version <= 0.12.5
# Since this script checks out former versions of Sinon, that had build scripts
# that relied on the directory layout of NPM versions < 3, it is wise to
# use `nvm` or `n` to set the current Node version to 0.12.5 or equivalent
# To support running this script when it is placed outside of the project
@fatso83
fatso83 / test-script.sh
Last active July 28, 2016 21:35
Test script to find the regression mentioned in #1046
#!/bin/bash
# test script built for use with `git bisect` to find a regression
# usage: git bisect start v1.16.1 v1.15.4 && git bisect run ../test-script.sh
# Alternatively run it manually and use `git bisect good/bad`
#
# Warning: You need a Node version <= 0.12.5
# Since this script checks out former versions of Sinon, that had build scripts
# that relied on the directory layout of NPM versions < 3, it is wise to
# use `nvm` or `n` to set the current Node version to 0.12.5 or equivalent