Skip to content

Instantly share code, notes, and snippets.

View Colorfulstan's full-sized avatar

Jonas Krispin Colorfulstan

View GitHub Profile
@Colorfulstan
Colorfulstan / gistbox_keyboard_shortcuts.md
Last active August 29, 2015 14:24
Here are some things you can do with Gists in GistBox.

keyboard shortcuts within GistBox

  • Up/Down - Previous/Next Gist
  • Ctrl+e - Edit a selected Gist
  • Ctrl+s - Save Gist
  • ESC - Cancel editing snippet
  • CTRL+F - search
@Colorfulstan
Colorfulstan / javascript_resources.md
Last active February 3, 2016 12:37 — forked from jookyboi/javascript_resources.md
Here are a set of libraries, plugins and guides which may be useful to your Javascript coding.

Libraries

  • AngularJS - Conventions based MVC framework for HTML5 apps.
  • Underscore - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
  • moment.js - Time formatting and manipulation
  • jQuery - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
  • Backbone - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
  • [lawnchair](http://br
@Colorfulstan
Colorfulstan / css_resources.md
Last active September 6, 2015 06:06 — forked from jookyboi/css_resources.md
CSS libraries and guides to bring some order to the chaos.

scripts

  • reset.css resetting settings in css that might be unwanted defaults
  • normalize.css more consistent rendering across various browsers

Libraries

  • frontend Frameworks comparison
  • 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
  • Compass - Open source CSS Authoring Framework.
  • Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
  • Zurb Foundation - Framework for writing responsive web sites.
@Colorfulstan
Colorfulstan / overwolf.d.ts
Last active October 9, 2015 16:53 — forked from punmechanic/overwolf.d.ts
Overwolf API definition file (not completely up to date)
interface OverwolfStatic {
utils: OverwolfUtils;
profile: OverwolfProfile;
extensions: OverwolfExtensions;
games: OverwolfGames;
media: OverwolfMedia;
settings: OverwolfSettings;
streaming: OverwolfStreaming;
windows: OverwolfWindows;
@Colorfulstan
Colorfulstan / javascript_loop_callbacks.js
Created September 6, 2015 19:15
passing callbacks using a loop-iteration counter
function create_callback(i){
return function callback(callbackParams) {
// do something with the "right" i
}
}
// create closures with the temporary i and store them for later
var funcs = [];
for (var i = 0; i < 5; i++) {
funcs[i] = create_callback(i);
can.Model.prototype.clone = function(){
var data = this.attr();
delete data[this.constructor.id];
return new this.constructor(data)
}
@Colorfulstan
Colorfulstan / html_utf-8.html
Created October 9, 2015 16:51
From http://kkovacs.eu/how-not-to-mess-up-encodings How to ensure utf-8 encoded database / html / php
<!-- and, for safety and consistency, also adding this to your html-head output: -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
@Colorfulstan
Colorfulstan / python_is64bit.py
Created October 30, 2015 08:05
check if 32 or 64 bit version of python is installed (python 2.6+)
import sys
is_64bits = sys.maxsize > 2**32
print is_64bits
@Colorfulstan
Colorfulstan / python_stacktrace_try_catch.py
Created November 13, 2015 12:25
try catch with stacktrace
import traceback
try:
raise ValueError
except:
tb = traceback.format_exc()
else:
tb = "No error"
finally:
print tb
var _mergeRecursive = function(obj1, obj2) {
//iterate over all the properties in the object which is being consumed
for (var p in obj2) {
// Property in destination object set; update its value.
if ( obj2.hasOwnProperty(p) && typeof obj1[p] !== "undefined" ) {
_mergeRecursive(obj1[p], obj2[p]);
} else {
//We don't have that level in the heirarchy so add it