View img2datauri
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')); |
View animated-dialog.html
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); | |
} |
View userChrome.css
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
/* hide normal menu */ | |
#PanelUI-button { display: none; } | |
/* hide customize toolbar button in the overflow menu */ | |
#overflowMenu-customize-button { display: none} | |
/* make overflow menu the normal menu */ | |
#nav-bar-overflow-button { | |
list-style-image: url("chrome://browser/skin/menu.svg") !important; | |
margin-right: 2px !important; |
View ytdwn.user.js
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 YT Download | |
// @description Adds a button that lets you download YouTube videos. | |
// @version 2.1.0 | |
// @date 2018-02-07 | |
// @include http://www.youtube.com/* | |
// @include https://www.youtube.com/* | |
// @exclude http://www.youtube.com/embed/* | |
// @exclude https://www.youtube.com/embed/* | |
// @match http://www.youtube.com/* |
View form-validation.html
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; |
View yt-downloader.user.js
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/* |
View form-observer.html
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
<form class="form"> | |
<input type="text" placeholder="enter text" name="name" value=""> | |
<input type="checkbox" name="check"> | |
<select name="select"><option value="select1">one</option><option value="select2">two</option></select> | |
<input name="radio" type="radio" value="radio1"> | |
<input name="radio" type="radio" value="radio2"> | |
</form> | |
<button class="start">Observe</button> | |
<button class="stop">Stop observing</button> |
View .gitconfig
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
[mergetool] | |
prompt = false | |
keepBackup = false | |
keepTemporaries = false | |
[merge] | |
tool = winmerge | |
[mergetool "winmerge"] | |
name = WinMerge |
View js-inheritance.js
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
if (!Function.prototype.bind) { | |
Function.prototype.bind = function (context) { | |
if (typeof this !== 'function') throw new TypeError('Function.prototype.bind - what is trying to be bound is not callable'); | |
var args = Array.prototype.slice.call(arguments, 1), | |
fToBind = this, | |
fn = function () {}, | |
fBound = function () { | |
return fToBind.apply(this instanceof fn && context ? this : context, | |
args.concat(Array.prototype.slice.call(arguments))); | |
}; |
View radial.js
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 s = 1, e = s + 4; | |
var data = d3.range(s, e); | |
var col = d3.scale.category10(); | |
var scal = d3.scale.linear() | |
.domain([data[0], data[data.length-1]]) | |
.range([0, 1]); | |
var g = d3.select('svg'); | |
var groups = g.selectAll('g').data(data).enter().append('g'); |
NewerOlder