Skip to content

Instantly share code, notes, and snippets.

@psema4
psema4 / Has weird right-to-left characters.txt
Created April 15, 2021 16:31 — forked from endolith/Has weird right-to-left characters.txt
Unicode kaomoji smileys emoticons emoji
ּ_בּ
בּ_בּ
טּ_טּ
כּ‗כּ
לּ_לּ
מּ_מּ
סּ_סּ
תּ_תּ
٩(×̯×)۶
٩(̾●̮̮̃̾•̃̾)۶
@psema4
psema4 / tmux-cheatsheet.markdown
Created March 7, 2021 16:40 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@psema4
psema4 / rename-tiles-to-sprites.sh
Created November 2, 2019 23:02
search and replace in filenames
# Search and replace filenames in the current directory
#
# Example:
# tile-000.png
# tile-001.png
# tile-002.png
#
# becomes
# sprite-000.png
# sprite-001.png
@psema4
psema4 / reset.js
Created June 21, 2019 17:46 — forked from 19h/reset.js
Node.js — Clear Terminal / Console. Reset to initial state.
console.reset = function () {
return process.stdout.write('\033c');
}
@psema4
psema4 / CreateJob.sh
Created December 3, 2018 13:51 — forked from stuart-warren/CreateJob.sh
Create a job in Jenkins (or folder) using the HTTP API
# check if job exists
curl -XGET 'http://jenkins/checkJobName?value=yourJobFolderName' --user user.name:YourAPIToken
# with folder plugin
curl -s -XPOST 'http://jenkins/job/FolderName/createItem?name=yourJobName' --data-binary @config.xml -H "Content-Type:text/xml" --user user.name:YourAPIToken
# without folder plugin
curl -s -XPOST 'http://jenkins/createItem?name=yourJobName' --data-binary @config.xml -H "Content-Type:text/xml" --user user.name:YourAPIToken
# create folder
@psema4
psema4 / events.js
Created October 23, 2018 13:44 — forked from tbranyen/events.js
Rethinking events using ES6 (https://tbranyen.com/events)
const bus = {};
const get = e => (bus[e] = bus[e] || new Set());
export const listeners = new Proxy(bus, { get });
export const emit = (e, ...args) => listeners[e].forEach(fn => fn(...args));
@psema4
psema4 / simpleSequencer.js
Created August 24, 2018 03:55
A simple webaudio sequencer
class SimpleSequencer {
/* SimpleSequencer essentially combines the following tutorials and wraps them in es6
*
* https://github.com/kylestetz/Web-Audio-Basics/tree/gh-pages/4-Continuous-Sequencing
* https://www.html5rocks.com/en/tutorials/audio/scheduling/
* http://clockworkchilli.com/blog/3_html5_drum_machine_with_web_audio
*
*
* Usage:
@psema4
psema4 / gist:a8003f1f09d77743e85750e6aefb7a65
Created August 8, 2018 04:06 — forked from borismus/gist:1032746
Convert a base64 string into a binary Uint8 Array
var BASE64_MARKER = ';base64,';
function convertDataURIToBinary(dataURI) {
var base64Index = dataURI.indexOf(BASE64_MARKER) + BASE64_MARKER.length;
var base64 = dataURI.substring(base64Index);
var raw = window.atob(base64);
var rawLength = raw.length;
var array = new Uint8Array(new ArrayBuffer(rawLength));
for(i = 0; i < rawLength; i++) {
@psema4
psema4 / prover.js
Created May 20, 2017 17:56 — forked from othiym23/prover.js
Simple proof-of-work server for Node.js.
'use strict';
/* To test:
* echo -n <input> | nc localhost 1337
*
* Results are <input>:<nonce>
*
* Passing e5fa44f2b31c1fb553b6021e7360d07d5d91ff5e should get back
* e5fa44f2b31c1fb553b6021e7360d07d5d91ff5e:2c8
*/