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
// Inspired by http://jsfiddle.net/evildonald/jLuF5/ | |
function detectIE() { | |
var $ = window.$ || window.jQuery || angular.element; | |
var s = document.body.style; | |
var version; | |
if (s.msTextCombineHorizontal !== undefined) { | |
version = 11; | |
} | |
else if (s.msFlexOrder !== undefined) { |
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 sparkline = new Sparkline([10,20,45,12], 120, 30, '#000', 'red'); | |
* document.body.appendChild(sprakline.render().canvas); | |
*/ | |
function Sparkline(data, width, height, lineColor, dotColor) { | |
this.canvas = document.createElement('canvas'); | |
this.canvas.width = width; | |
this.canvas.height = height; | |
this.lineColor = lineColor; |
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
function sharedStart(array) { | |
var A= array.concat().sort(), | |
a1= A[0], a2= A[A.length-1], L= a1.length, i= 0; | |
while(i<L && a1.charAt(i)=== a2.charAt(i)) i++; | |
return a1.substring(0, i); | |
} |
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
{ | |
"layers": [ | |
{ | |
"name": "canvas", | |
"type": "canvas", | |
"canvasLayers": [ | |
{ | |
"props": { | |
"active": { | |
"type": "boolean", |
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
{ | |
"layers": [ | |
{ | |
"active": true, | |
"mixBlendMode": "normal", | |
"name": "no-signal", | |
"opacity": 100, | |
"rotateX": 0, | |
"rotateY": 0, | |
"rotateZ": 0, |
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
<canvas id="canvas" width="400" height="300"></canvas> |
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
signals: | |
colorA: | |
type: hsla | |
defaultValue: 1 | |
input: null | |
hue: 180 | |
saturation: 50 | |
lightness: 50 | |
alpha: 100 | |
beatA: |
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
signals: | |
colorA: | |
type: hsla | |
defaultValue: '180,50%,50%,1' | |
input: null | |
hue: 180 | |
saturation: 50 | |
lightness: 50 | |
alpha: 100 | |
beatA: |
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
signals: | |
colorA: | |
type: hsla | |
defaultValue: '180,50%,50%,1' | |
input: null | |
hue: 180 | |
saturation: 50 | |
lightness: 50 | |
alpha: 100 | |
beatA: |
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
// can be runned from the Devel execute PHP page | |
use Drupal\image\Entity\ImageStyle; | |
$path = 'public://2018-03/26756519_10155441271337695_6783993404862700965_o.jpg'; | |
$thumbnail = ImageStyle::load('article'); | |
dpm($thumbnail->buildUrl($path)); | |
$dest = $thumbnail->buildUri($path); | |
dpm($dest); | |
$created = $thumbnail->createDerivative($path, $dest); |