Skip to content

Instantly share code, notes, and snippets.

Mark Goodyear markgoodyear

Block or report user

Report or block markgoodyear

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@markgoodyear
markgoodyear / run-current-sim.js
Created Aug 28, 2018
Runs react-native run-ios to the current open simulator
View run-current-sim.js
const child_process = require('child_process');
const runOnCurrentSim = () => {
try {
const simulators = JSON.parse(
child_process.execFileSync(
'xcrun',
['simctl', 'list', '--json', 'devices'],
{encoding: 'utf8'},
),
View rn-i18n-locale-identifiers.csv
Locale Identifier Description
af Afrikaans
af-NA Afrikaans (Namibia)
af-ZA Afrikaans (South Africa)
agq Aghem
agq-CM Aghem (Cameroon)
ak Akan
ak-GH Akan (Ghana)
am Amharic
am-ET Amharic (Ethiopia)
@markgoodyear
markgoodyear / SassMeister-input.scss
Created Nov 24, 2015
Generated by SassMeister.com.
View SassMeister-input.scss
// ----
// libsass (v3.2.5)
// ----
@mixin headings($from: 1, $to: 6) {
%headings-#{$from}-#{$to} {
@content
}
@if $from >= 1 and $to <= 6 {
View gulp-bower.js
var gulp = require('gulp');
var uglify = require('gulp-uglify');
var concat = require('gulp-concat');
var bower = require('main-bower-files');
gulp.task('bower', function () {
return gulp.src(bower())
.pipe(concat('vendor.js'))
.pipe(uglify())
.pipe(gulp.dest('/build/scripts'));
@markgoodyear
markgoodyear / noRepeat.js
Created Jul 28, 2015
Swap `background-repeat: none` to `background-repeat: no-repeat`: https://twitter.com/hugogiraudel/status/625966606351495168
View noRepeat.js
var noRepeat = function () {
return function (css) {
css.eachDecl('background-repeat', function (decl) {
if (decl.value.indexOf('none') !== -1) {
decl.value = 'no-repeat';
}
});
};
};
View headhesive-swap-image.js
{
onStick: function () {
document.querySelector('.img-elem').src = '/path/to/stick-img.png'
},
onUnstick: function () {
document.querySelector('.img-elem').src = '/path/to/unstick-img.png'
},
}
View Get structure pos.twig
{# Get the IDs of all the sections #}
{% set currentSectionId = entry.id %}
{% set allSectionIds = craft.entries.section('myStructure').level(1).ids() %}
{# Define var before loop #}
{% set sectionNumber = '' %}
{# Loop through all section IDs and find the one that matches the current #}
{% for key, sectionId in allSectionIds if sectionId == currentSectionId %}
@markgoodyear
markgoodyear / SassMeister-input-HTML.html
Created Nov 27, 2014
Generated by SassMeister.com.
View SassMeister-input-HTML.html
<p>Normal</p>
<a class="btn btn--primary">Button</a>
<a class="btn btn--primary btn--outline">Button</a>
<a class="btn btn--secondary">Button</a>
<a class="btn btn--secondary btn--outline">Button</a>
<a class="btn btn--tertiary">Button</a>
<a class="btn btn--tertiary btn--outline">Button</a>
@markgoodyear
markgoodyear / SassMeister-input-HTML.html
Created Nov 26, 2014
Generated by SassMeister.com.
View SassMeister-input-HTML.html
<p>Normal</p>
<a class="btn btn--primary">Button</a>
<a class="btn btn--primary btn--outline">Button</a>
<a class="btn btn--secondary">Button</a>
<a class="btn btn--secondary btn--outline">Button</a>
<a class="btn btn--tertiary">Button</a>
<a class="btn btn--tertiary btn--outline">Button</a>
View extend.js
function extend (target, source) {
var a = Object.create(target);
Object.keys(source).map(function (prop) {
a[prop] = source[prop];
});
return a;
};
You can’t perform that action at this time.