Skip to content

Instantly share code, notes, and snippets.

View escapedcat's full-sized avatar

escapedcat escapedcat

View GitHub Profile
@escapedcat
escapedcat / SassMeister-input.scss
Created August 6, 2014 09:15
Generated by SassMeister.com.
// ----
// Sass (v3.3.14)
// Compass (v1.0.0.rc.1)
// ----
.my-list {
color: red;
&__item {
color: pink;
@escapedcat
escapedcat / what-forces-layout.md
Created September 29, 2015 04:28 — forked from paulirish/what-forces-layout.md
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Element

Box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
  • elem.clientLeft, elem.clientTop, elem.clientWidth, elem.clientHeight
  • elem.getClientRects(), elem.getBoundingClientRect()
@escapedcat
escapedcat / Fastfile
Last active April 28, 2016 10:01
Cordova iOS App deployment to HockeyApp using Fastlane / Match / Gym; including code signing identity
# Customise this file, documentation can be found here:
# https://github.com/fastlane/fastlane/tree/master/docs
# All available actions: https://github.com/fastlane/fastlane/blob/master/docs/Actions.md
# can also be listed using the `fastlane actions` command
# Change the syntax highlighting to Ruby
# All lines starting with a # are ignored when running `fastlane`
# By default, fastlane will send which actions are used
# No personal data is shared, more information on https://github.com/fastlane/enhancer
@escapedcat
escapedcat / regex-pattern.js
Last active May 18, 2016 10:02
Regex Chinese Mobilphone numbers
// https://en.wikipedia.org/wiki/Telephone_numbers_in_China
var regexp = /(1[34578]\d{9})/;
atom settings here
@escapedcat
escapedcat / get-npm-package-version
Created October 24, 2017 13:30 — forked from DarrenN/get-npm-package-version
Extract version from package.json (NPM) using bash / shell
# Version key/value should be on his own line
PACKAGE_VERSION=$(cat package.json \
| grep version \
| head -1 \
| awk -F: '{ print $2 }' \
| sed 's/[",]//g')
echo $PACKAGE_VERSION
@escapedcat
escapedcat / yourCtrl.js
Last active February 13, 2018 17:48
angular-google-maps directions service example
addresses = addressService.query();
addresses.$promise.then(function (result) {
console.log('task query done');
createWaypointsFromAddresses(addresses);
return uiGmapGoogleMapApi;
})
.then( function(maps) {
@escapedcat
escapedcat / package.json
Last active May 16, 2018 09:39
npm scripts including node-sass and autoprefixer
{
"name": "foo",
"version": "1.0.0",
"description": "foo project",
"main": "index.js",
"scripts": {
"start": "npm run serve | npm run watch-css",
"serve": "./node_modules/.bin/http-server -p 8080",
"build-css": "./node_modules/node-sass/bin/node-sass app/sass/style.scss -o app/css/ && ./node_modules/postcss-cli/bin/postcss --use autoprefixer app/css/style.css -d app/css/",
"watch-css": "nodemon -e scss -x 'npm run build-css'"
@escapedcat
escapedcat / jSignatureDirective.js
Last active May 22, 2018 19:40
AngularJS Directive for jSignature (simple)
/*
* https://github.com/brinley/jSignature
*
* based on:
* "jSignature": "2.0.2",
* "angular": "1.3.11",
* "jquery": "2.1.3"
*
* include at least these jSignature files:
* 'jSignature/src/jSignature.js',
@escapedcat
escapedcat / app.js
Created July 28, 2014 10:19
basic webpack angularjs example, based on phonecatApp tutorial (phonecat)
var phonecatAnimations = require("./animations.js");
var phonecatControllers = require("./controllers.js");
var phonecatFilters = require("./filters.js");
var phonecatServices = require("./services.js");
'use strict';
/* App Module */
var phonecatApp = angular.module('phonecatApp', [