Skip to content

Instantly share code, notes, and snippets.

// Option 1
async function streamToString(stream: NodeJS.ReadableStream): Promise<string> {
const chunks: Array<any> = [];
for await (let chunk of stream) {
chunks.push(chunk)
}
const buffer = Buffer.concat(chunks);
return buffer.toString("utf-8")
}
@7dir
7dir / main.js
Created January 16, 2017 12:58 — forked from staltz/main.js
A-Frame + Cycle.js demo
import xs from 'xstream';
import Cycle from '@cycle/xstream-run';
import {h, makeDOMDriver} from '@cycle/dom';
require('aframe');
function main(sources) {
let vdom$ = xs.periodic(16).startWith(0).map(i =>
h('a-scene', [
h('a-sphere', {
attrs: {
@7dir
7dir / Sublime Text 3 Build 3103 License Key - CRACK
Created January 4, 2017 13:55
Sublime Text 3 Build 3103 License Key - CRACK
I use the first
—– BEGIN LICENSE —–
Michael Barnes
Single User License
EA7E-821385
8A353C41 872A0D5C DF9B2950 AFF6F667
C458EA6D 8EA3C286 98D1D650 131A97AB
AA919AEC EF20E143 B361B1E7 4C8B7F04
@staltz
staltz / main.js
Created June 22, 2016 15:06
A-Frame + Cycle.js demo
import xs from 'xstream';
import Cycle from '@cycle/xstream-run';
import {h, makeDOMDriver} from '@cycle/dom';
require('aframe');
function main(sources) {
let vdom$ = xs.periodic(16).startWith(0).map(i =>
h('a-scene', [
h('a-sphere', {
attrs: {
@filiph
filiph / helloworld.dart
Created June 18, 2016 00:28
The smallest possible hello world program in Dart.
main() => print("Hello World!");
@soundyogi
soundyogi / 2018_chrome_snippet_gui_import_export.js
Last active December 24, 2023 22:09
A snippet to export and import your chrome snippets
void function() { "use strict"
/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! WIP DO NOT USE WIP !!!!!!!!!!!!!!!!!!!!!
DO NOT USE THIS YET.
USE THE 2016 VERSION BELOW PLEASE.
WWWWWWWW WWWWWWWWIIIIIIIIIIPPPPPPPPPPPPPPPPP
W::::::W W::::::WI::::::::IP::::::::::::::::P
W::::::W W::::::WI::::::::IP::::::PPPPPP:::::P
@githubutilities
githubutilities / README.md
Last active October 21, 2022 02:23
Shadowsocks proxy and ssh proxy

Shadowsocks Proxy

apt-get install python-pip
pip install shadowsocks

sudo ssserver -p 443 -k password -m aes-256-cfb --user nobody -d start
@fritzy
fritzy / 1_triggers.sql
Last active April 7, 2024 20:07
Get table change notifications from Postgres as JSON
CREATE OR REPLACE FUNCTION table_update_notify() RETURNS trigger AS $$
DECLARE
id bigint;
BEGIN
IF TG_OP = 'INSERT' OR TG_OP = 'UPDATE' THEN
id = NEW.id;
ELSE
id = OLD.id;
END IF;
PERFORM pg_notify('table_update', json_build_object('table', TG_TABLE_NAME, 'id', id, 'type', TG_OP)::text);
@Youka
Youka / fiddle_test.rb
Created December 30, 2014 13:21
Simple use of ruby's fiddle library for windows messageboxes
# Load importer part of fiddle (ffi) library
require 'fiddle/import'
# Create module as body for an importer instance
module MessageBox
# Extend this module to an importer
extend Fiddle::Importer
# Load 'user32' dynamic library into this importer
dlload 'user32'
# Set C aliases to this importer for further understanding of function signatures
@magicznyleszek
magicznyleszek / jekyll-and-liquid.md
Last active January 12, 2024 03:46
Jekyll & Liquid Cheatsheet

Jekyll & Liquid Cheatsheet

A list of the most common functionalities in Jekyll (Liquid). You can use Jekyll with GitHub Pages, just make sure you are using the proper version.

Running

Running a local server for testing purposes: