Made for rule-of-thumb; you need to understand SQL well to modify these queries for your own taste.
SET @@profiling=1; SET @@profiling_history_size = 100;
//made with jQuery 3.1.1. | |
//attach this function to any HTML action and you'll get the response | |
//- Katamori, 10-25-2016 | |
function Init(){ | |
clientID = //ID of the Reddit app you registered, as a string//; | |
clientSec = //secret part of the same app; | |
//Authorization to Reddit API |
(function(global){ | |
"use strict"; | |
function constEnumPropValueDesc(v){ | |
return { | |
value: v, | |
enumerable: true, | |
configurable: false, | |
writable: false | |
}; |
# usage ./yt.sh <https://youtube.com/watch?v=....> | |
urldecode() { | |
local url_encoded="${1//+/ }" | |
printf '%b' "${url_encoded//%/\\x}" | |
} | |
video_url="$1" | |
raw_url=$(curl \ | |
-H 'Upgrade-insecure-requests: 1' \ | |
-H 'Cache-control: max-age=0' \ | |
-H 'Accept-language: en-US,en;q=0.8,bn;q=0.6' \ |
Made for rule-of-thumb; you need to understand SQL well to modify these queries for your own taste.
SET @@profiling=1; SET @@profiling_history_size = 100;
/* | |
In the node.js intro tutorial (http://nodejs.org/), they show a basic tcp | |
server, but for some reason omit a client connecting to it. I added an | |
example at the bottom. | |
Save the following server in example.js: | |
*/ | |
var net = require('net'); |
IPFS is an amazing service, but lacks certain shorthand functionality, so instead of creating these for myself and then forgetting forever, I decided to share it with the community.
Sometimes, even if you pin content, you may not want to pin a whole directory as a whole. For those purposes, however, there's no way to list a directory content with its hashes in any particular order.
For that, there's a lot of Linux shell tools you can use:
/* | |
* Sharing it here because it took me a while to find out. | |
* If you need to use asynchronous operations in the router handlers specified in HapiJS (via `server.route()`), | |
* the methods shown in the tutorial won't help. The handler method itself has to be specified like this: | |
*/ | |
{ | |
method: 'GET', | |
path: '/', | |
handler: async function (request, h) { |
let bcrypt = require('bcrypt-nodejs'); | |
let password = "hello"; | |
let stored_hash = ""; | |
// first generate a random salt | |
function genSalt(password) { | |
return new Promise((resolve,reject) => { | |
bcrypt.genSalt(10,function(err,salt) { | |
if (err) { |
ec2-54-152-134-146.compute-1.amazonaws.com.
var game; | |
function createGame() { | |
game = new MyGame.Game(); | |
game.state.onStateChange.add(function (state) { | |
if (state === 'menu') { | |
runTests(); // wait for boot + preload to complete before running tests | |
} | |
}, this); | |
game.play(); // init's game and sets the initial Phaser.State |