Skip to content

Instantly share code, notes, and snippets.

Avatar

Adam Lutz adamlutz

View GitHub Profile
@adamlutz
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(user.id, function() {
console.log('user deleted')
@adamlutz
adamlutz / config.fish
Last active Jan 23, 2021
config.fish (git)
View config.fish
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/Postgres.app/Contents/Versions/latest/bin $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
adamlutz / prompt.fish
Last active Jan 23, 2021
git fish prompt
View prompt.fish
# 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 com.apple.finder AppleShowAllFiles -bool true
@adamlutz
adamlutz / application.html.slim
Created Jan 31, 2017
rails 5 slim default application layout
View application.html.slim
doctype html
html
head
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
body
@adamlutz
adamlutz / mechanized_search.rb
Last active Jun 2, 2016
mechanized cancer.gov search
View mechanized_search.rb
require 'rubygems'
require 'ruby-progressbar'
require 'mechanize'
require 'pry'
require 'csv'
agent = Mechanize.new { |agent|
agent.user_agent_alias = 'Mac Safari'
}
@adamlutz
adamlutz / fish_prompt.fish
Created Jan 4, 2016
./config/fish/functions/fish_prompt.fish
View fish_prompt.fish
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)
end
# PWD
set_color $fish_color_cwd
echo -n (prompt_pwd)
@adamlutz
adamlutz / sublime.config
Last active Jan 4, 2016
sublime config
View sublime.config
{
"ensure_newline_at_eof_on_save": true,
"ignored_packages":
[
"Vintage"
],
"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/ \
--server=lutz.meteor.com
install android studio: http://developer.android.com/sdk/installing/index.html?pkg=studio
start new project + create AVD from API 22.
$ brew install android-platform-tools
$ meteor add-platform android
View .bash_profile
export PATH=/Applications/Postgres.app/Contents/Versions/9.4/bin:$PATH
export PATH="$PATH":~/bin
if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi