Skip to content

Instantly share code, notes, and snippets.

View ourmaninamsterdam's full-sized avatar

Justin Perry ourmaninamsterdam

View GitHub Profile
@mrdanadams
mrdanadams / _pems.scss
Created March 29, 2012 13:32
PX to EMs conversion in Sass
/* 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;
@k33g
k33g / kind.js
Created April 2, 2012 20:29
Re Use Object Model of BackBone
// 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
@balupton
balupton / README.md
Last active January 21, 2017 00:40
DocPad: Paging Solutions

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)
@tomas-stefano
tomas-stefano / Capybara.md
Last active April 10, 2024 15:27
Capybara cheatsheet

Capybara Actions

# Anchor
click_link 'Save'

# Button
click_button 'awesome'

# Both above
@mattjburrows
mattjburrows / Require JS global property module
Created March 4, 2014 20:36
Require JS module for getting / setting data required in multiple modules
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: {
@mmcgahan
mmcgahan / gist:9fa045d98c7c122f1c0b
Created June 18, 2014 19:09
Handlebars template inheritance
# 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}}
@yoavniran
yoavniran / ultimate-ut-cheat-sheet.md
Last active April 13, 2024 16:19
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai, Sinon, and Jest
@ourmaninamsterdam
ourmaninamsterdam / LICENSE
Last active February 21, 2024 23:28
Arrayzing - The JavaScript array cheatsheet
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:
@chris-schra
chris-schra / next.config.js
Last active March 1, 2023 13:55
Custom bootstrap for next js server
let entryModified = false;
module.exports = {
webpack: (config, { buildId, dev, isServer, defaultLoaders, webpack }) => {
if(dev && config.entry && !entryModified)
{
require('@babel/register')({
extensions: ['.js', '.jsx', '.ts', '.tsx']
})