Skip to content

Instantly share code, notes, and snippets.


Adam Lutz adamlutz

View GitHub Profile
adamlutz / intercom_user_delete.js
Created Sep 5, 2018
Node Intercom user deletion (w/o paging)
View intercom_user_delete.js
const Intercom = require('intercom-client');
const app_token = '<intercom app token>'
const client = new Intercom.Client({token: app_token});
client.users.list(function (d) {
const users = d.body.users
users.forEach(function(user) {
client.users.requestPermanentDeletion(, function() {
console.log('user deleted')
adamlutz /
Last active Jan 23, 2021 (git)
set -x PATH /opt/homebrew/bin $PATH
set -x PATH /usr/local/bin $PATH
set -x PATH /usr/local/sbin $PATH
set -x PATH ~/bin $PATH
set -x PATH /Applications/ $PATH
set PATH $HOME/.rbenv/shims $PATH
set PATH $HOME/.rbenv/bin:$PATH
rbenv rehash >/dev/null ^&1
status --is-interactive; and source (rbenv init -|psub)
adamlutz /
Last active Jan 23, 2021
git fish prompt
# use custom function instead of fish built in git prompt due to performance
# (fish git prompt uses diff which can be slow)
function git_prompt
# uses simple grep and colrm instead of complicated sed regex
set -l branch (git branch 2> /dev/null | grep --color=never -e '*.\(.*\)' | colrm 1 2)
# use git status to improve performance (instead of using diff)
# [MADRC] - if file is modified
# ? - if untracked file exists
set -l git_dirty (git status -s | colrm 3 | colrm 1 1 | grep --color=never -e '[MADRC]')
View gist:6f697493f8a8090ae9dd15e5bfa2d044
$ defaults write AppleShowAllFiles -bool true
adamlutz / application.html.slim
Created Jan 31, 2017
rails 5 slim default application layout
View application.html.slim
doctype html
title My App
meta name="viewport" content="width=device-width, initial-scale=1.0"
= stylesheet_link_tag "application", media: 'all', 'data-turbolinks-track' => true
= javascript_include_tag "application", 'data-turbolinks-track' => true
= csrf_meta_tags
adamlutz / mechanized_search.rb
Last active Jun 2, 2016
mechanized search
View mechanized_search.rb
require 'rubygems'
require 'ruby-progressbar'
require 'mechanize'
require 'pry'
require 'csv'
agent = { |agent|
agent.user_agent_alias = 'Mac Safari'
adamlutz /
Created Jan 4, 2016
function fish_prompt --description 'Write out the prompt'
set -l last_status $status
if not set -q __fish_prompt_normal
set -g __fish_prompt_normal (set_color normal)
set_color $fish_color_cwd
echo -n (prompt_pwd)
adamlutz / sublime.config
Last active Jan 4, 2016
sublime config
View sublime.config
"ensure_newline_at_eof_on_save": true,
"trim_trailing_white_space_on_save": true,
"tab_size": 2,
"translate_tabs_to_spaces": true,
View meteor cordova android
install meteor
deploy app to meteor cloud
$ meteor build ~/Meteor/ \
install android studio:
start new project + create AVD from API 22.
$ brew install android-platform-tools
$ meteor add-platform android
View .bash_profile
export PATH=/Applications/$PATH
export PATH="$PATH":~/bin
if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi