Skip to content

Instantly share code, notes, and snippets.

@markgoodyear
markgoodyear / SassMeister-input.scss
Created November 24, 2015 10:54
Generated by SassMeister.com.
// ----
// libsass (v3.2.5)
// ----
@mixin headings($from: 1, $to: 6) {
%headings-#{$from}-#{$to} {
@content
}
@if $from >= 1 and $to <= 6 {
// Styles
gulp.task('styles', function() {
return gulp.src(config.sources.styles)
.pipe(sass({ errLogToConsole: true, outputStyle: 'expanded' }))
.pipe(prefix('last 2 version', 'safari 5', 'ie 8', 'ie 9', 'opera 12.1', 'ios 6', 'android 4'))
.pipe(gulpif(isProduction, mincss({ keepSpecialComments: 0 })))
.pipe(header(banner))
.pipe(gulp.dest(config.output.styles))
.pipe(reload(server));
});
@markgoodyear
markgoodyear / task.js
Created October 11, 2014 09:54
Concat all modules first in Angular
var paths = {
src: [
'src/scripts/app/**/*module*.js',
'src/scripts/app/**/*.js'
],
dest: 'app/assets/scripts'
};
gulp.task('scripts', function () {
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 / rn-i18n-locale-identifiers.csv
Created April 3, 2018 16:25 — forked from ndbroadbent/rn-i18n-locale-identifiers.csv
React Native i18n Locale Identifiers
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 / run-current-sim.js
Created August 28, 2018 16:06
Runs react-native run-ios to the current open simulator
const child_process = require('child_process');
const runOnCurrentSim = () => {
try {
const simulators = JSON.parse(
child_process.execFileSync(
'xcrun',
['simctl', 'list', '--json', 'devices'],
{encoding: 'utf8'},
),
function scrollTo(Y, duration, easingFunction, callback) {
var start = Date.now(),
elem = document.documentElement.scrollTop?document.documentElement:document.body,
from = elem.scrollTop;
if(from === Y) {
callback();
return; /* Prevent scrolling to the Y point if already there */
}
@markgoodyear
markgoodyear / 01-gulpfile.js
Last active May 5, 2023 03:21
Comparison between gulp and Grunt. See http://markgoodyear.com/2014/01/getting-started-with-gulp/ for a write-up.
/*!
* gulp
* $ npm install gulp-ruby-sass gulp-autoprefixer gulp-cssnano gulp-jshint gulp-concat gulp-uglify gulp-imagemin gulp-notify gulp-rename gulp-livereload gulp-cache del --save-dev
*/
// Load plugins
var gulp = require('gulp'),
sass = require('gulp-ruby-sass'),
autoprefixer = require('gulp-autoprefixer'),
cssnano = require('gulp-cssnano'),