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 / 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 / GenericsDemo.java
Last active August 29, 2015 13:57
Example of using parametrised multiple bounds in Java 7.This is just showing how stuff is connected - it really does not make any sense in itself.Compiles with JDK7.
/*
Example of using parametrised multiple bounds in Java 7.
This is just showing how stuff is connected - it really does not make any sense in itself.
Compiles with JDK7.
*/
import java.util.ArrayList;
import java.util.List;
// parametrised interfaces
interface IF1<T>{T returnIt();}
@fatso83
fatso83 / Errors with color coding
Created May 19, 2014 23:52
Errors when running mocha tests of npm-kit
 4 failing
 1) Kit should parse imports:
 Error: Line 1 in imports.kit: You're attempting to import a file that does not exist in the specified location: someFile.kit" -->
at Kit._findFile (C:\tmp\node-kit\lib\node-kit.js:365:11)
at Kit._handleImport (C:\tmp\node-kit\lib\node-kit.js:316:21)
at Kit._compileToken (C:\tmp\node-kit\lib\node-kit.js:285:35)
at Kit.compile (C:\tmp\node-kit\lib\node-kit.js:110:14)
at Kit.toString (C:\tmp\node-kit\lib\node-kit.js:122:28)
at kit (C:\tmp\node-kit\lib\node-kit.js:21:25)
@fatso83
fatso83 / Gruntfile.js
Created June 26, 2014 21:44
Grunt file that shows how dynamic config (and option!) values are not used in the grunt-contrib-concat task, but picked up by other tasks
// Grunt file that shows how dynamic config (and option!) values
// are not used in the grunt-contrib-concat task. Run using 'grunt'
module.exports = function(grunt){
grunt.initConfig({
concat : {
foo : {
src: '<%= grunt.config.get("myfiles") %>',
dest : 'outfile.txt'
@fatso83
fatso83 / pre-commit
Created June 27, 2014 13:32
pre-commit hook for the framework: sanity checking and testing
#!/bin/sh
check() {
cd develop && npm install && grunt sanity-checks
}
if [[ $(git symbolic-ref --short HEAD) == 'internal' ]]; then
echo On internal branch - testing commit
check
fi
@fatso83
fatso83 / post-commit
Created June 27, 2014 13:34
post-commit hook for jira integration
#!/usr/bin/env python
##########################################################################
# Copyright 2009 Broadcom Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
@fatso83
fatso83 / log4javascript_uncompressed.js
Last active August 29, 2015 14:03
log4javascript patched to use native formatting in BrowserConsoleAppender
/**
* HACKED VERSION of 1.4.9 - has native console.log formatting of objects
*
*
* Copyright 2014 Tim Down.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
/*
* Utility "class" extending Array with lookup functions
*
* Can do everything an Array can, including indexing by brackets,
* use in loop constructions (for, while), etc
*
* Example:
* var foo = new Foo({id : 1})
* foo.getId() === 1; // => true
* var c = new Collection();
@fatso83
fatso83 / space_remover.py
Created October 28, 2014 12:25
Script to remove spaces from all file and folder names under a certain directory root.
# space_remover.py
#
# Script to remove spaces at the end of folder or file names
# This is a problem when creating a folder on a platform other
# than Windows and sharing that folder with a Windows user
# The Windows user will then not be able to work with files
# within that folder.
# The solution is simply to remove the space at the end of
# the folder name, but this is not possible to do through
# the Windows GUI interface. Normal "CMD" also has problems.
@fatso83
fatso83 / mp3_make_comp
Last active March 13, 2024 11:47
Set the TCMP flag on all the MP3′s in the current directory, or the files specified on the command line.
#!/usr/bin/perl -w
# mp3_make_comp
# Max Baker
# 4/29/09
#
# This script will set the I-Tunes Compilation Tag (TCMP)
# on Files passed to it. If no files are passed, it works on *.mp3 in the current directory.
#
# found here: http://warped.org/blog/2009/05/02/itunes-setting-the-compilation-flag-on-mp3s-using-perl/