Skip to content

Instantly share code, notes, and snippets.

View attilah's full-sized avatar
🏠
Working from home

Attila Hajdrik attilah

🏠
Working from home
View GitHub Profile
@tshevchuk
tshevchuk / Async_Request__c.object
Last active September 4, 2024 13:57
Utility class to enqueue Queueable Jobs.
Custom Object with the following fields:
* Apex_Class_Name__c - Text(255)
* Params__c - Long Text Area(131072)
* Status__c - Picklist (New, Enqueued, Error)
* Async_Apex_Job_Id__c - Text(18) (Unique Case Insensitive)
* Error_Message__c - Long Text Area(32768)
@fnky
fnky / stripe-keys-and-ids.tsv
Last active October 10, 2024 11:40
Stripe keys and IDs
Prefix Description Notes
ac_ Platform Client ID Identifier for an auth code/client id.
acct_ Account ID Identifier for an Account object.
aliacc_ Alipay Account ID Identifier for an Alipay account.
ba_ Bank Account ID Identifier for a Bank Account object.
btok_ Bank Token ID Identifier for a Bank Token object.
card_ Card ID Identifier for a Card object.
cbtxn_ Customer Balance Transaction ID Identifier for a Customer Balance Transaction object.
ch_ Charge ID Identifier for a Charge object.
cn_ Credit Note ID Identifier for a Credit Note object.
@bbc4468
bbc4468 / influx_schema.sql
Last active July 25, 2024 02:51
Influx DB Schema for OHLC
create database price_history_db
CREATE CONTINUOUS QUERY "cq_1m" ON "price_history_db" BEGIN SELECT MIN(price) as low, MAX(price) as high, FIRST(price) as open, LAST(price) as close, SUM(size) as volume INTO "price_1m" FROM "trade" GROUP BY time(1m), symbol END
CREATE CONTINUOUS QUERY "cq_5m" ON "price_history_db" BEGIN SELECT MIN(low) as low, MAX(high) as high, FIRST(open) as open, LAST(close) as close, SUM(volume) as volume INTO "price_5m" FROM "price_1m" GROUP BY time(5m), symbol END
CREATE CONTINUOUS QUERY "cq_15m" ON "price_history_db" BEGIN SELECT MIN(low) as low, MAX(high) as high, FIRST(open) as open, LAST(close) as close, SUM(volume) as volume INTO "price_15m" FROM "price_5m" GROUP BY time(15m), symbol END
CREATE CONTINUOUS QUERY "cq_1h" ON "price_history_db" BEGIN SELECT MIN(low) as low, MAX(high) as high, FIRST(open) as open, LAST(close) as close, SUM(volume) as volume INTO "price_1h" FROM "price_15m" GROUP BY time(1h), symbol END
CREATE CONTINUOUS QUERY "cq_6h" ON "price_history_db" BEGIN SELECT
@vlasky
vlasky / debugeventemitter.js
Last active May 30, 2020 11:04
Debugging code to help track down events that cause EventEmitter memory leaks in Node.js
//Is Node.js reporting warning messages like this?:
//
// "Warning: Possible EventEmitter memory leak detected. 11 wakeup listeners added. Use emitter.setMaxListeners() to increase limit"
//
//The following code will intercept calls to addListener() and on() and print the type of event and generate an Error exception
//With a stack trace to help you find the cause
var EventEmitter = require('events').EventEmitter;
const originalAddListener = EventEmitter.prototype.addListener;
@matthewjberger
matthewjberger / notes.md
Last active March 11, 2024 10:21
How to make an electron app using Create-React-App and Electron with Electron-Builder.
@vlucas
vlucas / pre-push.sh
Created July 22, 2014 16:12
Prevent Pushes Directly to Master
#!/bin/bash
# @link https://gist.github.com/mattscilipoti/8424018
#
# Called by "git push" after it has checked the remote status,
# but before anything has been pushed.
#
# If this script exits with a non-zero status nothing will be pushed.
#
# Steps to install, from the root directory of your repo...
@benbuckman
benbuckman / intercept-stdout.js
Created May 20, 2012 15:42 — forked from pguillory/gist:729616
Hooking into Node.js stdout, pipe stdout to telnet
var _ = require('underscore'),
util = require('util');
// intercept stdout, passes thru callback
// also pass console.error thru stdout so it goes to callback too
// (stdout.write and stderr.write are both refs to the same stream.write function)
// returns an unhook() function, call when done intercepting
module.exports = function interceptStdout(callback) {
var old_stdout_write = process.stdout.write,
old_console_error = console.error;