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
$.each(State.stores, function(e,i) { State.stores[e] = 1000000000; }) | |
OR | |
var high = 100000 | |
var checkAll = setInterval(function() { | |
var bn = [ | |
'attack', | |
'attack_bolas', | |
'attack_bone-spear', |
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
#!/bin/bash | |
case $# in | |
0) | |
echo "Usage: $0 {start|stop}" | |
exit 1 | |
;; | |
1) | |
case $1 in | |
start) |
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
//Returns ISO 8601 week number and year | |
Date.prototype.getFullWeek = function(){ | |
var jan1, w, d = new Date(this); | |
d.setDate(d.getDate()+4-(d.getDay()||7)); // Set to nearest Thursday: current date + 4 - current day number, make Sunday's day number 7 | |
jan1 = new Date(d.getFullYear(),0,1); // Get first day of year | |
w = Math.ceil((((d-jan1)/86400000)+1)/7); // Calculate full weeks to nearest Thursday | |
return {y: d.getFullYear(), w: w }; | |
}; | |
//Returns ISO 8601 week number | |
Date.prototype.getWeek = function(){ |
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
console.clear(); | |
var img = new Image(); | |
img.src = 'img/img.png'; | |
img.onload = function () { | |
var canvas = document.createElement('canvas'), context = canvas.getContext('2d'); | |
canvas.width = img.width; | |
canvas.height = img.height; | |
context.drawImage(img, 0, 0, img.width, img.height); | |
console.log(canvas.toDataURL('image/png')); |
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
String.prototype.fuzzy = function (s) { | |
var hay = this.toLowerCase(), i = 0, n = -1, l; | |
s = s.toLowerCase(); | |
for (; l = s[i++] ;) if (!~(n = hay.indexOf(l, n + 1))) return false; | |
return true; | |
}; | |
('a haystack with a needle').fuzzy('hay sucks'); // false | |
('a haystack with a needle').fuzzy('sack hand'); // true |
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
/** | |
* https://gist.github.com/tborychowski/3799025 | |
*/ | |
var UTILS = { | |
/*jshint maxlen: 500, onevar: false */ | |
isTouch : (/iPhone|iPod|iPad/ig).test(navigator.userAgent), | |
/** | |
* Modified & lintified version of https://gist.github.com/527683 |
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
<!DOCTYPE html> | |
<head> | |
<meta charset=UTF-8> | |
<title>Dialog demo</title> | |
<style> | |
.dialog { | |
border: none; | |
border-radius: 3px; | |
box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); | |
} |
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
<!DOCTYPE html> | |
<head> | |
<meta charset="UTF-8"> | |
<title></title> | |
<link rel="stylesheet" href="css/style.css"> | |
<style> | |
html { height: 100%; } | |
body { | |
font-family: sans-serif; | |
font-weight: 300; |
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
// ==UserScript== | |
// @name Download YouTube Videos as MP4 | |
// @description Adds a button that lets you download YouTube videos. | |
// @homepageURL https://github.com/gantt/downloadyoutube | |
// @author Gantt | |
// @version 1.8.8 | |
// @date 2016-09-02 | |
// @namespace http://googlesystem.blogspot.com | |
// @include http://www.youtube.com/* | |
// @include https://www.youtube.com/* |
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
(2500).toLocaleString("en-GB", {style: "currency", currency: "GBP", minimumFractionDigits: 2}) |
NewerOlder