Skip to content

Instantly share code, notes, and snippets.

@tj
tj / querying.md
Last active February 8, 2024 17:48
Querying for https://apex.sh/logs/

Apex Logs utilizes a purpose-built query language for searching and aggregating structured log events.

Events

An Apex Log event requires the following properties:

Name Type Description
id string The unique identifier of the event.
@tj
tj / git aliases.sh
Last active January 14, 2024 10:37
Some helpful git aliases
alias gd="git diff"
alias gc="git clone"
alias ga="git add"
alias gbd="git branch -D"
alias gst="git status"
alias gca="git commit -a -m"
alias gpt="git push --tags"
alias gp="git push"
alias gpr="git pull-request"
alias grh="git reset --hard"
// Alternative JavaScript Syntax
Person = :(name, address) { @name!, @address! }
Person::inspect = :{ <: "{@name} lives at {@address}" }
tj := Person('TJ', '314 Bessborough ave')
bob := Person('Bob', 'Some place')
[tj, bob].each(:(person){ print(person.inspect()) })
@tj
tj / update.js
Last active April 29, 2023 14:53
shouldComponentUpdate utility
let rows = {}
export default function(props = [], state = []) {
return function(target) {
const proto = Object.create(target.prototype)
proto.shouldComponentUpdate = function(newProps, newState) {
let id = (this._update_id = this._update_id || Math.random())
@tj
tj / asya
Created January 24, 2018 18:39
...e$e.$...e$ ...e$e.$...e
!$6lkasd!$6lkasd!$6l !$6lkasd!$6lkasd!
;,a1wert;,a1wert;,a1wert ;,a1wert;,a1wert;,a1we
.asxzcvb.asxzcvb.asxzcvb.as .asxzcvb.asxzcvb.asxzcvb.
1qaswedfqas1wedfqas1wedfqas1wedfqas1wedfqas1edfqas1ewdfqa
:lkjhgfdlkj:hgfdlkj:hgfdlkj:hgfdlkj:hgfdlkj:gfdhlkj:gfdhlk
3edcvfr4edc3vfr4edc3vfr4edc3vfr4edc3vfr4edc3fr4vedc3fr4ved
1234ewqa2341ewqa2341ewqa2341ewqa2341ewqa2341wqa2341weqa234
o[piuytr[piouytr[piouytr[piouytr[piouytr[pioytru[pioytru[p
z/xcvbnm/xczvbnm/xczvbnm/xczvbnm/xczvbnm/xczbnmv/xczbnmv/x
@tj
tj / deploy.conf
Created May 24, 2011 22:43
start of deployment script
key /path/to/whatever.pem
user deployer-of-doom
addr n.n.n.n
repo git@github.com:visionmedia/express.git
path /path/to/www/whatever
branch origin/master
command /path/to/www/whatever/restart
@tj
tj / haml.js
Created December 18, 2009 19:00
/* ex:ts=2:et: */
/*jslint bitwise: true, browser: true, eqeqeq: true, evil: true, immed: true, newcap: true,
nomen: true, plusplus: true, regexp: true, undef: true, white: true, indent: 2 */
/*globals */
var Haml = {};
// Bind to the exports object if it exists. (CommonJS and NodeJS)
if (exports) {
Haml = exports;
@tj
tj / app.js
Last active October 4, 2021 19:38
const http = require('http')
const rpc = require('./rpc')
/**
* Pets service.
*/
class Pets {
constructor(db = []) {
@tj
tj / app.js
Created August 31, 2012 05:33
users online with redis
var express = require('express');
var redis = require('redis');
var db = redis.createClient();
var app = express();
// track users online (replace UA string with user id)
app.use(function(req, res, next){
var ua = req.headers['user-agent'];