Skip to content

Instantly share code, notes, and snippets.

Avatar

Justin Perry ourmaninamsterdam

View GitHub Profile
@ourmaninamsterdam
ourmaninamsterdam / LICENSE
Last active Jan 25, 2022
Arrayzing - The JavaScript array cheatsheet
View LICENSE
The MIT License (MIT)
Copyright (c) 2015 Justin Perry
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
@yoavniran
yoavniran / ultimate-ut-cheat-sheet.md
Last active Jan 23, 2022
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai, Sinon, and Jest
View ultimate-ut-cheat-sheet.md
@mmcgahan
mmcgahan / gist:9fa045d98c7c122f1c0b
Created Jun 18, 2014
Handlebars template inheritance
View gist:9fa045d98c7c122f1c0b
# Template composition with inclusion
Every template language I have seen provides some mechanism for one template to include another, thus supporting the reuse of repeated elements like headers and footers. The included templates are called partials in Mustache parlance:
```html
<!-- home.hbs -->
<html>
<body>
{{> header}}
<p> HOME </p>
{{> footer}}
@mattjburrows
mattjburrows / Require JS global property module
Created Mar 4, 2014
Require JS module for getting / setting data required in multiple modules
View Require JS global property module
define(function() {
// Set the privately scoped object.
// Its properties are modified via the get / set methods returned from the module.
// We can keep values private by setting the 'private' part to true and set the 'value' part as the property value.
var helper = {
foo: {
'private': true,
'value': 'Private var'
},
classes: {
@tomas-stefano
tomas-stefano / Capybara.md
Last active Jan 27, 2022
Capybara cheatsheet
View Capybara.md

Capybara Actions

# Anchor
click_link 'Save'

# Button
click_button 'awesome'

# Both above
@balupton
balupton / README.md
Last active Jan 21, 2017
DocPad: Paging Solutions
View README.md

DocPad: Paging Solutions

  • post.html.eco used for displaying prev and next page links on your current page (static site friendly)
  • posts.html.eco used for displaying a content listing, that is split up onto multiple pages (requires dynamic site)
  • paged plugin used for splitting a document into a different pages, very neat (static site friendly)
@k33g
k33g / kind.js
Created Apr 2, 2012
Re Use Object Model of BackBone
View kind.js
// Just do this : (and include backbone.js)
var Kind = function() {
this.initialize && this.initialize.apply(this, arguments);
};
Kind.extend = Backbone.Model.extend
//Simpler
var Thing = function() {};
Thing.extend = Backbone.Model.extend
@mrdanadams
mrdanadams / _pems.scss
Created Mar 29, 2012
PX to EMs conversion in Sass
View _pems.scss
/* See http://mrdanadams.com/2012/pixel-ems-css-conversion-sass-mixin/ */
/* Default font size in pixels if not overridden. */
$baseFontSize: 16;
/* Convert PX units to EMs.
Ex: margin-right: pem(16);
*/
@function pem($pxval, $base: $baseFontSize) {
@return #{$pxval / $base}em;