Skip to content

Instantly share code, notes, and snippets.

weisk

Block or report user

Report or block weisk

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View orbitControls.js
/**
* @author qiao / https://github.com/qiao
* @author mrdoob / http://mrdoob.com
* @author alteredq / http://alteredqualia.com/
* @author WestLangley / http://github.com/WestLangley
*/
THREE.OrbitControls = function ( object, domElement ) {
View git.md

Git

git remote add : git remote add syngular syngular.es:strategems.git

git pull --rebase upstream branch git pull --rebase origin develop vs. git merge upstream/branch

@weisk
weisk / script.js
Created Mar 1, 2019
randomest in js
View script.js
// window
let array = new Uint32Array(10);
crypto.getRandomValues(array);
// node
crypto.randomBytes(10).toString('utf8');
@weisk
weisk / mongo.js
Last active Mar 1, 2019
mongo stuff, aggregation framework
View mongo.js
db.auth('admin', '9b2EpmkFtasdfas--wrxo-NVwZp');
const SERIAL = '3e84e930-b6af-11e8-a512-9d2b3d7cbb08';
const DESCRIPTION = 'PLC_1';
const NTAGS = 22;
const MAX_ROWS = 100;
const pipelineBefore = [
{ $match: { serial: SERIAL, description: DESCRIPTION } },
{ $group: { _id: "$date", name: { $first: "$name" }, count: { $sum: 1 }} },
@weisk
weisk / index.js
Created Sep 30, 2018
Babel node starter 2018
View index.js
(async () => {
console.log('hi!');
})()
@weisk
weisk / i18n.js
Created Oct 7, 2017
Util.promisify example - read files from directory, parse JSONs, copy
View i18n.js
#!/usr/bin/env node
const fs = require('fs');
const path = require('path');
const { promisify } = require('util');
const { ncp } = require('ncp');
const readDir = promisify(fs.readdir);
const readFile = promisify(fs.readFile);
const copyDir = promisify(ncp);
@weisk
weisk / html5-video-streamer.js
Created Jun 9, 2017 — forked from lleo/html5-video-streamer.js
This is an enhancement to Gist#1993068 https://gist.github.com/paolorossi/1993068 . I found what was needed to demonstrate a functioning video stream was a HTML file with a <video> tag pointing to the streamer.
View html5-video-streamer.js
#!/usr/bin/env node
/*
* Inspired by: http://stackoverflow.com/questions/4360060/video-streaming-with-html-5-via-node-js
* Modified from https://gist.github.com/paolorossi/1993068
*/
var http = require('http')
, fs = require('fs')
, util = require('util')
@weisk
weisk / index.js
Created Jun 1, 2017
es2017 node starter boilerplate
View index.js
import something from './somewhere';
export default function() {
console.log('hi');
}
@weisk
weisk / prime_generator.js
Created Sep 29, 2016 — forked from ajace/prime_generator.js
nodejs script to generate prime numbers
View prime_generator.js
#!/usr/bin/env node
var fs = require('fs');
var outfile = "primes.txt";
var count = 0;
var maxCount = 100;
var primes = [];
var i = 2;
@weisk
weisk / 0_reuse_code.js
Created Aug 28, 2016
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
You can’t perform that action at this time.