This file contains hidden or 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
'use strict'; | |
import React from 'react'; | |
import Quill from 'quill'; | |
import uid from 'uid'; | |
export default React.createClass({ | |
getInitialState() { | |
return { | |
id: `editor-${ uid() }`, | |
idToolbar: `toolbar-${ uid() }`, |
This file contains hidden or 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 registerTranslations() { | |
$trans = get_option('translations'); | |
$translations = explode('|', $trans); | |
$group = 'bs_'; | |
foreach($translations as $str) { | |
pll_register_string($str, $str, $group, true); | |
} | |
} |
This file contains hidden or 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
'use strict'; | |
export const each = fn => arr => Array.prototype.forEach.call(arr, fn); | |
export const map = fn => arr => Array.prototype.map.call(arr, fn); | |
export const reduce = (fn, initial = {}) => arr => Array.prototype.reduce.call(arr, fn, initial); | |
export const on = (event, fn) => el => el.addEventListener(event, fn); |
This file contains hidden or 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
'use strict'; | |
var each = function each(fn) { | |
return function (arr) { | |
return Array.prototype.forEach.call(arr, fn); | |
}; | |
}; | |
var map = function map(fn) { | |
return function (arr) { | |
return Array.prototype.map.call(arr, fn); |
This file contains hidden or 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
module.exports = { | |
watch: true, | |
entry: { | |
app: './client/app.js', | |
admin: './client/admin/app.js' | |
}, | |
output: { | |
path: './public/js', | |
filename: '[name].js' | |
}, |
This file contains hidden or 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
// Place your key bindings in this file to overwrite the defaults | |
[ | |
{ | |
"key": "shift+cmd+d", | |
"command": "editor.action.copyLinesDownAction" | |
}, | |
{ | |
"key": "shift+alt+p", | |
"command": "workbench.action.git.push" | |
}, |
This file contains hidden or 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
mongoexport --db calendar --collection users --type=csv --fields name,lastname,email,mobile,phone,position --out users.csv |
This file contains hidden or 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 getCapture(red, green, blue, gradientPosition, gcolor1, gcolor2) { | |
canvas.width = video.videoWidth; | |
canvas.height = video.videoHeight; | |
ctx.clearRect(0, 0, canvas.width, canvas.height); | |
ctx.drawImage(video, 0, 0); | |
var imgData = ctx.getImageData(0, 0, canvas.width, canvas.height); | |
imgData = setRgb(imgData, red, green, blue); |
This file contains hidden or 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 c = document.getElementById("myCanvas"); | |
var ctx = c.getContext("2d"); | |
c.width = 500; | |
c.height = 500; | |
function createCircles(x, y, r) { | |
ctx.fillStyle = "#012754"; | |
ctx.beginPath(); |
This file contains hidden or 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 extend(a, b) { | |
for( var key in b ) { | |
if( b.hasOwnProperty( key ) ) { | |
if(typeof b[key] === "object") { | |
a[key] = extend(a[key], b[key]); | |
} | |
else { | |
a[key] = b[key]; | |
} | |