Skip to content

Instantly share code, notes, and snippets.

View cacheflow's full-sized avatar
🎯
Focusing

Lex Alexander cacheflow

🎯
Focusing
View GitHub Profile
class Student {
constructor(name, email) {
this.name = name;
this.email = email;
}
}
class Bootcamp {
constructor(name, level, students = []) {
const processTasks = async (tasks, wait) => {
let paused = false;
let kill = false;
const pause = () => paused = true;
const resume = () => paused = false;
const abort = () => kill = true;
const emailAddresses = [
'jumbotron99@yahoo.com',
'kanye.west@gmail.com',
'leviclothing@outlook.com',
'hey@godswillumukoro.com',
]
const isNullOrUndefined = (data) => data === null || data === undefined;
const getEmailServiceProvider = (email) => {
rename-branch() {
current_branch_name="$(git branch --show-current)"
renamed_branch="$1"
eval '$(git branch -m ${current_branch_name} ${renamed_branch})'
}
@cacheflow
cacheflow / postgres_queries_and_commands.sql
Created September 26, 2020 02:44 — forked from zafergurel/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- https://www.geekytidbits.com/performance-tuning-postgres/
-- http://www.craigkerstiens.com/2012/10/01/understanding-postgres-performance/
-- http://okigiveup.net/what-postgresql-tells-you-about-its-performance/
-- https://wiki.postgresql.org/wiki/Introduction_to_VACUUM,_ANALYZE,_EXPLAIN,_and_COUNT
-- https://devcenter.heroku.com/articles/postgresql-indexes#b-trees-and-sorting
-- http://www.databasesoup.com/2014/05/new-finding-unused-indexes-query.html
-- performance tools
-- https://www.vividcortex.com/resources/network-analyzer-for-postgresql
-- show running queries (pre 9.2)
{
"presets": [
["@babel/preset-env", {
"debug": false,
"modules": false,
"useBuiltIns": false
}]
],
"plugins": [
"@babel/syntax-dynamic-import",
def messages(options)
query(messages: options)
end
const pSBCr = (d) => {
let n = d.length,
x = {};
if (n > 9) {
([r, g, b, a] = d = d.split(",")), (n = d.length);
if (n < 3 || n > 4) return null;
(x.r = i(r[3] == "a" ? r.slice(5) : r.slice(4))),
(x.g = i(g)),
(x.b = i(b)),
(x.a = a ? parseFloat(a) : -1);
@cacheflow
cacheflow / deploy_hooks.yml
Last active May 29, 2020 22:03 — forked from oliphunt/deploy_hooks.yml
Cloud66 custom deploy hook for configuring papertrail to log application logs. These go in your `.cloud66` deployment folder.
production:
after_rails:
- source: /.cloud66/log_files.yml
destination: /etc/log_files.yml
sudo: true
target: rails
apply_during: build_only
- source: /.cloud66/remote_syslog.init.d
destination: /etc/init.d/remote_syslog
@cacheflow
cacheflow / deploy_hooks.yml
Created May 29, 2020 21:50 — forked from armchairlinguist/deploy_hooks.yml
Cloud66 custom deploy hook for configuring papertrail to log application logs. These go in your `.cloud66` deployment folder.
production:
after_symlink:
- source: /.cloud66/log_files.yml
destination: /etc/log_files.yml
sudo: true
target: any
apply_during: all
- source: /.cloud66/remote_syslog.init.d
destination: /etc/init.d/remote_syslog