Skip to content

Instantly share code, notes, and snippets.

View ediblecode's full-sized avatar

Ian Routledge ediblecode

View GitHub Profile
@tomaash
tomaash / mocha-runner.js
Last active September 22, 2016 11:30
mocha-runner.js
process.env.NODE_PATH = "app";
require("module").Module._initPaths();
require("babel/register");
var uncache = require("require-uncache");
var _ = require("lodash");
var glob = require("glob").sync;
var Mocha = require("mocha");
var chokidar = require('chokidar');
@manuhabitela
manuhabitela / _grid.scss
Last active January 11, 2021 14:15
Making the Bootstrap grid with Susy and sass-mq
// this is (a start of) an example of a Susy+mq() setup that mimics bootstrap grid.
// I work on multiple bootstrap-based projects.
// I want to stop using grid classes in the markup, and start using mixins with susy and sass-mq.
// Since the project is heavily tied to the bootstrap grid, I want to have the exact same behavior
// between bootstrap classes (old code) and susy mixins (new code).
// all the grid classes generated below are here to ease up testing.
// required: susy + sass-mq
@tjchaplin
tjchaplin / gist:621edccbfddc0d3526b5
Created January 23, 2015 11:00
Update Teamcity Build Number based on package.json - (Powershell <= 2)
# These are project build parameters in TeamCity
# Depending on the branch, we will use different major/minor versions
[System.Reflection.Assembly]::LoadWithPartialName("System.Web.Extensions")
$ser = New-Object System.Web.Script.Serialization.JavaScriptSerializer
$json = Get-Content "package.json" | Out-String
$obj = $ser.DeserializeObject($json)
$majorVerion = ($obj['version'] -split "\.")[0]
$minorVerion = ($obj['version'] -split "\.")[1]
$buildCounter = "%teamcity.build.counter%"
$buildNumber = "$majorVerion.$minorVerion.$buildCounter"
@cvrebert
cvrebert / css_regression_testing.md
Last active May 9, 2023 12:13
Survey of screenshot-based CSS testing tools

Currently considering https://github.com/webdriverio/webdrivercss


Core Goals:

  • Can test in up-to-date versions of all major browsers
  • Can test on up-to-date versions of all major OSes
  • Can test in IE9 (because Bootstrap v4 will support IE9+)
  • Don't want to have to setup/maintain our own cluster of VMs running all the necessary OSes (and all the versions of Windows)
  • Workflow for management of reference/baseline/norm screenshots
@KittyGiraudel
KittyGiraudel / SassMeister-input.scss
Last active November 22, 2016 11:19
Generated by SassMeister.com.
// ----
// Sass (v3.4.9)
// Compass (v1.0.1)
// ----
@function is-number($value) {
@return type-of($value) == 'number';
}
@function is-time($value) {
@marcusgadbem
marcusgadbem / index.js
Last active November 25, 2021 22:20
Middleware to minify HTML output for express template render engines in which supports callbacks
/* app/controllers/index.js */
module.exports.index = function(req, res) {
res.render('index.html');
};
@onestepcreative
onestepcreative / check_media_query.js
Last active March 27, 2020 07:41
Fast way to check media queries in javascript (based on Foundation 5 sizing)
// Each statement returns true or false based on current viewport
// The EM units are based on html, body { font-size: 100%; } CSS
window.MQ = {
// max-width 640px mobile-only styles
small : (matchMedia('only screen and (max-width: 40em)').matches),
// min-width 641px and max-width 1024px screen only
medium : (matchMedia('only screen and (min-width:40.063em) and (max-width:64em)').matches),
@lavoiesl
lavoiesl / object.create.js
Created September 20, 2013 18:49
Javascript Object.create() polyfill
// http://jsperf.com/new-vs-object-create-including-polyfill
if (typeof Object.create !== 'function') {
Object.create = function(o, props) {
function F() {}
F.prototype = o;
if (typeof(props) === "object") {
for (prop in props) {
if (props.hasOwnProperty((prop))) {
F[prop] = props[prop];
@stevenkuhn
stevenkuhn / gist:5062660
Last active March 7, 2023 16:03
This PowerShell script generates release notes for Octopus Deploy that contain the GitHub commits and JIRA issues from the current build to the latest production release. It will also create the Octopus release based on the TeamCity build number.
#
# Assumptions
#
# 1. If you have a Octopus release deployed, say 1.0.0.73, there is a git
# tag set for that commit in GitHub that is "v1.0.0.73".
#
# 2. You have TeamCity label each successful build in GitHub with the format
# "v{build number}. Sidenote: it appears that TeamCity only labels the
# default branch, but not feature branches.
#
@malarkey
malarkey / Contract Killer 3.md
Last active May 17, 2024 15:28
The latest version of my ‘killer contract’ for web designers and developers

When times get tough and people get nasty, you’ll need more than a killer smile. You’ll need a killer contract.

Used by 1000s of designers and developers Clarify what’s expected on both sides Helps build great relationships between you and your clients Plain and simple, no legal jargon Customisable to suit your business Used on countless web projects since 2008

…………………………