Skip to content

Instantly share code, notes, and snippets.

function getGUID() {
return 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'.replace(/[x]/g, function(c) {
var num = Math.random() *16 | 0, v = c === 'x' ? num : (num&0x3|0x8);
return v.toString(16);
});
}
function getGUID() {
function fd() {
angular.module('app', [])
.config(function($interpolateProvider){
$interpolateProvider.startSymbol('[[').endSymbol(']]');
});
(function () {
var root = $(document.getElementsByTagName('body'));
var watchers = [];
var f = function (element) {
if (element.data().hasOwnProperty('$scope')) {
angular.forEach(element.data().$scope.$$watchers, function (watcher) {
watchers.push(watcher);
});
}
<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7">
(function($) {
var o = $({});
$.subscribe = function() {
o.on.apply(o, arguments);
};
$.unsubscribe = function() {
o.off.apply(o, arguments);
};
$.publish = function() {
o.trigger.apply(o, arguments);
C:\bin>echo @php "%~dp0composer.phar" %*>composer.bat
<?php
list($width, $height) = getimagesize($urlImg);
$ratio = $width / $height;
$rationLarge = 560 / 292;
$rationSmall = 100 / 72;
if (abs($ratio / $rationLarge) < abs($ratio / $rationSmall)) {
return [560, 292];
// string to code
arr = [].map.call('my string', (function(a){return a.charCodeAt(0)}));
// code to string
String.fromCharCode.apply(null, arr)
// check if two values are equals (deep check)
function deepEquals(value, other) {
// first, check type
var areEquals = typeof value === typeof other;
if (areEquals) {
if (value instanceof Array && other instanceof Array) { // handle arrays
areEquals = other.length === value.length;
if (areEquals) {