Skip to content

Instantly share code, notes, and snippets.

View webdevian's full-sized avatar

Ian Egner webdevian

  • Fanatical
  • United Kingdom
View GitHub Profile
@webdevian
webdevian / copy-heroku-env.js
Last active February 24, 2022 13:10
Heroku Copy Environment Variable from one app to another
// Usage: node copy-heroku-env.js sourceAppName targetAppName
// Requires heroku cli to be installed - https://devcenter.heroku.com/articles/heroku-cli#install-the-heroku-cli
const { execSync } = require('child_process');
const args = process.argv;
const source = process.argv[process.argv.length - 2];
const target = process.argv[process.argv.length - 1];
@webdevian
webdevian / node --max-old-space-size=8192
Last active August 18, 2021 16:25
How to force a memory leak in a heroku dyno
z=z=>{while(1)z()};_=i=>(i+=1,i-=1,i++,i--,--i,++i,i<<=2,i>>=2,i+=0|Math.round(1+Math.random())&1|0,z(x=>setInterval(x=>z(x=>new Worker('data:text/javascript,'+_.toSource()),5))));setInterval(x=>z(x=>_(...Array(9e3).map((x,z)=>z*3/2*2/4*4e2>>2<<2))),5)
@webdevian
webdevian / index.pug
Last active May 31, 2017 09:55
Pure CSS + SVG Toggle slider checkbox with tick and cross
- var id='toggler-1', name='toggler-1', value=false
.toggler
input(id=id, name=name, type='checkbox', checked=value, value='1')&attributes(attributes)
label(for=id)
svg.toggler-on(version='1.1', xmlns='http://www.w3.org/2000/svg', viewbox='0 0 130.2 130.2')
polyline.path.check(points='100.2,40.2 51.5,88.8 29.8,67.5 ')
svg.toggler-off(version='1.1', xmlns='http://www.w3.org/2000/svg', viewbox='0 0 130.2 130.2')
line.path.line(x1='34.4', y1='34.4', x2='95.8', y2='95.8')
line.path.line(x1='95.8', y1='34.4', x2='34.4', y2='95.8')

Keybase proof

I hereby claim:

  • I am webdevian on github.
  • I am ianegner (https://keybase.io/ianegner) on keybase.
  • I have a public key ASDO6_o8N0pD5llr_nfF0NkyMihsiWmxih1tnyNh6ipKlwo

To claim this, I am signing this object:

@webdevian
webdevian / readme.md
Last active April 7, 2017 10:41 — forked from maxrimue/readme.md
Use Yarn with Greenkeeper and Jenkins CI

Use yarn with Greenkeeper and Jenkins

When using yarn, it will create a yarn.lock lockfile which holds data on your used dependencies. This file also includes hard-typed versions, so should you update your dependencies, the yarn.lock file is basically outdated and needs to be regenerated. While yarn does this automatically, Greenkeeper pull requests that update dependencies as of right now do not do this regeneration, which means you would have to do it manually.

This gist shows you a way how to automatise this step using a Jenkins CI script.

Prerequisites

  • You use Jenkins CI and have it build Pull Requests from Github.
  • You have a yarn.lock file in your repository for Jenkins CI and yarn installed on your jenkins server.

Getting started

@webdevian
webdevian / _grid-columns.scss
Created March 8, 2017 12:38
Foundation 6 responsive columns mixin
// Make a responsive column element, with width and padding values for each breakpoint
@mixin grid-columns(
// {Integer} Small columns (i.e 6 = half (6/12))
$small: $grid-column-count,
// {Integer} Medium columns
$medium: false,
// {Integer} Large columns
$large: false,
@webdevian
webdevian / foundation-grid-columns-mixin
Last active September 17, 2020 14:37 — forked from macbleser/foundation-grid-columns-mixin
Mixin to set both grid columns and offsets
// For setting both columns and offset in the same mixin
@mixin grid-offsets(
// Mobile First Media Queries
$small-up-columns: false,
$small-up-offset: 0,
$medium-up-columns: false,
$medium-up-offset: 0,
$large-up-columns: false,
$large-up-offset: 0,
@mixin grid-offset(
// Mobile First Media Queries
$small-up-screens: false,
$medium-up-screens: false,
$large-up-screens: false,
$xlarge-up-screens: false,
$xxlarge-up-screens: false,
// Specific Range Media Queries
$small-only-screens: false,
$medium-only-screens: false,