Skip to content

Instantly share code, notes, and snippets.

@djtriptych
djtriptych / PTK.md
Last active January 31, 2023 19:05
ptk notes

PTK

TOC

  • Tech Overview

    • Publishing pipeline. What happens when you click "publish"
  • Requirements to publish.

@djtriptych
djtriptych / setup.bash
Last active July 26, 2018 20:33
JS Playground
# Basic directory structure
mkdir -p dist src
# Install and use the latest node 10.x.x
nvm install 10
nvm use 10
# Create package.json
node init -y
@djtriptych
djtriptych / entities.json
Last active March 29, 2017 22:24
Parsing HTML entities
[
{
"category": "Cc",
"entities": [
"Tab"
],
"set": "mmlextra",
"title": "CHARACTER TABULATION",
"dec": "#9",
"hex": "#x00009",
@djtriptych
djtriptych / rdb.py
Created April 29, 2013 16:30
Simple Redis-backed ORM
#!/usr/bin/env python
"""
db - Save and load data models in Redis.
~~
"""
# TODO: Key object to manage separating class name from key name.
@djtriptych
djtriptych / clearhack.py
Created November 30, 2012 00:01
python clear hack
# saran = clear wrap. get it?
def saran(f):
def g(*args, **kwargs):
d = f(*args, **kwargs)
try:
_clear = d.pop('clear')
except KeyError:
return d
d['clear'] = _clear
return d
@djtriptych
djtriptych / splice.xml
Created March 29, 2012 22:00 — forked from anonymous/splice.xml
Splicer job
<job>
<!-- The source URL for the PDF -->
<source href="http://1ticket.com/viewpdf2.asp?bypassid=%7BA0ECAFB4-B1DF-4DE7-BB96-DABA1C91BDCC%7D" />
<!-- The callback URL to call when the job is complete -->
<option name="callback" value="http://1ticket.com/callback.asp" />
<!-- When true ignore case when searching for matches -->
<option name="ignorecase" value="true" />
<!-- When false, allow substring matches -->
<option name="exact" value="false" />
<!-- A list of zero or more splices -->
@djtriptych
djtriptych / dfw.sh
Created February 21, 2012 21:59
Download full DFW interview.
#!/usr/bin/env bash
# Part 1
cclive http://www.youtube.com/watch?v=N5IDAnB_rns
# Part 2
cclive http://www.youtube.com/watch?v=AlUmT_biDwI
# Part 3
cclive https://www.youtube.com/watch?v=LPIKae5qRwM
@djtriptych
djtriptych / build.sh
Created January 16, 2012 04:02
Tools I Use
We couldn’t find that file to show.
@djtriptych
djtriptych / fizzbuzz.js
Created January 12, 2012 06:59
FizzBuzz implementations with no if/else statements.
// Do 'fizzbuzz' for numbers from 1 to n, no if/else
var fizzbuzz = function (n) {
var i = 0;
while (i++ < n)
console.log(i, !(i%15)&&'fizzbuzz'||!(i%5)&&'buzz'||!(i%3)&&'fizz'||i);
};
// Do fizzbuzz recursively (no loop structures)
var fizzbuzz_r = function (n) {
@djtriptych
djtriptych / fizzbuzz.js
Created January 11, 2012 07:51
OKCoder examples
// fizzbuzz.js
// Author: Triptych
// Study on fizzbuzz
// Note: You can run this code in your scratchpad. Just copy & paste.
//
// ignore the next line; it's for nerds.
if (!console && print) var console = {log:print};
// Correct "fizzbuzz" implementation.