This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 1. Visit a news website like cnn.com | |
// 2. paste this into your console | |
setInterval(() => | |
document.querySelectorAll('p,img,a,button,h1,h2,h3,span') | |
.forEach(x=>x.style=`transform:rotate(${Math.random()*777}deg) scale(${Math.random()* 3}); transition:all .5s`) | |
, 500); | |
// 3. feel a lil bit better 😘 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 🔥 Node 7.6 has async/await! Here is a quick run down on how async/await works | |
const axios = require('axios'); // promised based requests - like fetch() | |
function getCoffee() { | |
return new Promise(resolve => { | |
setTimeout(() => resolve('☕'), 2000); // it takes 2 seconds to make coffee | |
}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// eslint-disable-line | |
/* eslint-disable no-alert, no-console */ | |
/* eslint-disable */ | |
alert('foo'); | |
/* eslint-enable */ | |
// eslint-disable-line no-use-before-define |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// NEW API | |
const sketch = require('sketch'); | |
const document = sketch.getSelectedDocument(); | |
const selection = document.selectedLayers; | |
const layerSelected = selection.layers[0]; | |
const style = layerSelected.style; | |
const borders = style.borders; | |
// OLD API | |
const doc = context.document; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var debug = debug || {}; | |
debug = { | |
on : false, | |
startTime: 0, | |
partialTime: 0, | |
// start the profiling | |
start : function(){ | |
debug.on = true; | |
startTime = Date.now(); | |
partialTime = Date.now(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Old way | |
export const LAYERTYPES = { | |
symbol: { | |
master: 'MSSymbolMaster', | |
instance: 'MSSymbolInstance', | |
}, | |
artboard: 'MSArtboardGroup', | |
text: 'MSTextLayer', | |
group: 'MSLayerGroup', | |
shape: 'MSShapeGroup', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const COLOR = { | |
keys: { | |
gray: 'gray', | |
ultraLight: 'ultra-light', | |
veryLight: 'very-light', | |
bright: 'bright', | |
veryDark: 'very-dark', | |
veryDarkGray: 'very-dark-gray', | |
}, | |
ranges: [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Outline all classes. | |
*/ | |
[class] { | |
outline: 5px solid lightgrey; | |
} | |
/** | |
* Outline all BEM Elements. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//include GA tracking code before the closing head tag | |
add_action('wp_head', 'google_analytics_tracking_code'); | |
function google_analytics_tracking_code() { ?> | |
<!-- Google Analytics --> | |
<script> | |
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ | |
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), | |
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) |
NewerOlder