Enter this in the search box along with your search terms:
Get all gists from the user santisbon.
user:santisbon
Find all gists with a .yml extension.
extension:yml
Find all gists with HTML files.
language:html
function loadFile(src, cb) { | |
var xhr = new XMLHttpRequest(); | |
var s = []; | |
xhr.open("GET", src, true); | |
xhr.onreadystatechange = function() { | |
if (xhr.readyState == 4) { | |
if (xhr.status < 400 && xhr.responseText) { | |
s = [src,xhr.responseText] | |
} else if (xhr.status >= 400) { | |
s = [src, "✖ Error " + xhr.status + " while fetching file: " + xhr.statusText] |
var gulp = require('gulp'); | |
var sourcemaps = require('gulp-sourcemaps'); | |
var source = require('vinyl-source-stream'); | |
var buffer = require('vinyl-buffer'); | |
var browserify = require('browserify'); | |
var watchify = require('watchify'); | |
var babel = require('babelify'); | |
function compile(watch) { | |
var bundler = watchify(browserify('./src/index.js', { debug: true }).transform(babel)); |
// ==UserScript== | |
// @name Use Markdown, sometimes, in your HTML. | |
// @author Paul Irish <http://paulirish.com/> | |
// @link http://git.io/data-markdown | |
// @match * | |
// ==/UserScript== | |
// If you're not using this as a userscript just delete from this line up. It's cool, homey. |
const fetch = require('node-fetch'); | |
const fs = require('fs'); | |
const jsdom = require("jsdom"); | |
const { | |
JSDOM | |
} = jsdom; | |
const argv = require('minimist')(process.argv.slice(2)) | |
const options = { | |
runScripts: "dangerously", | |
resources: "usable", |
#!/usr/bin/perl | |
my $blanked = 0; | |
open (IN, "xscreensaver-command -watch |"); | |
while (<IN>) { | |
if (m/^(BLANK|LOCK)/) { | |
if (!$blanked) { | |
system "sound-off"; | |
$blanked = 1; | |
} |
// MIT License: | |
// | |
// Copyright (c) 2010-2012, Joe Walnes | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
// copies of the Software, and to permit persons to whom the Software is | |
// furnished to do so, subject to the following conditions: |
Enter this in the search box along with your search terms:
Get all gists from the user santisbon.
user:santisbon
Find all gists with a .yml extension.
extension:yml
Find all gists with HTML files.
language:html
function getFlatObject(object) { | |
function iter(o, p) { | |
if (Array.isArray(o) ){ | |
o.forEach(function (a, i) { | |
iter(a, p.concat(i)); | |
}); | |
return; | |
} | |
if (o !== null && typeof o === 'object') { | |
Object.keys(o).forEach(function (k) { |
/* | |
https://stackoverflow.com/a/50059015/8652537 | |
*/ | |
function hooksvg(elementID) { //Hook in the contentDocument of the svg so we can fire its internal scripts | |
var svgdoc, svgwin, returnvalue = false; | |
var object = (typeof elementID === 'string' ? document.getElementById(elementID) : elementID); | |
if (object && object.contentDocument) { | |
svgdoc = object.contentDocument; | |
} | |
else { |
async function newguy(){ | |
let response = await fetch('https://api.github.com/repos/javascript-tutorial/en.javascript.info/commits?per_page=100'); | |
const reader = response.body.getReader(); | |
// Step 2: get total length | |
const contentLength = +response.headers.get('Content-Length'); | |
// Step 3: read the data |