Skip to content

Instantly share code, notes, and snippets.

@owzzz
owzzz / destructuring.js
Created September 4, 2017 16:42 — forked from mikaelbr/destructuring.js
Several demos and usages for ES6 destructuring. Runnable demos and slides about the same topic: http://git.mikaelb.net/presentations/bartjs/destructuring
// === Arrays
var [a, b] = [1, 2];
console.log(a, b);
//=> 1 2
// Use from functions, only select from pattern
var foo = () => [1, 2, 3];
@owzzz
owzzz / .gitconfig
Created September 3, 2017 04:33 — forked from maninak/.gitconfig
# delete section if you don't use meld. Everyone's wierd in some way, I don't judge.
[merge]
tool = meld
[branch]
autosetuprebase = always
[push]
default = simple
followTags = true
@owzzz
owzzz / README-Template.md
Created January 13, 2017 16:38 — forked from regexident/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Synopsis

At the top of the file there should be a short introduction and/ or overview that explains what the project is. This description should match descriptions added for package managers (Gemspec, package.json, etc.)

Motivation

@owzzz
owzzz / javascript_resources.md
Created October 22, 2013 09:48 — forked from jookyboi/javascript_resources.md
Here are a set of libraries, plugins and guides which may be useful to your Javascript coding.

Libraries

  • 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.
  • 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.
  • lawnchair - Key/value store adapter for indexdb, localStorage
@owzzz
owzzz / 0_reuse_code.js
Created October 22, 2013 09:48
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
'use strict';
module.exports = function (grunt) {
// load all grunt tasks
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
// set up config
grunt.initConfig({
// Define the module.
define(
[
"require"
],
function( require ){
// Define the states of loading for a given set of modules
// within a require() statement.
@owzzz
owzzz / enqueue_script_conditional.php
Created November 5, 2012 21:57 — forked from clarklab/enqueue_script_conditional.php
WordPress conditional JS enqueue
<?php
if (is_page('Contact')) {
wp_register_script( 'contact-form', 'http://ajax.googleapis.com/contact-form.js');
wp_enqueue_script( 'contact-form' );
}
?>