Skip to content

Instantly share code, notes, and snippets.

@captainsafia
captainsafia / mac_dev_setup.sh
Created August 14, 2018 01:06
A set of commands I use to configure my Mac for development
# Create a global gitignore for macOS
cat https://raw.githubusercontent.com/github/gitignore/master/Global/macOS.gitignore >> ~/.gitignore_global
git config --global core.excludesfile ~/.gitignore_global
# Send screenshots to a directory that isn't the desktop
mkdir -p ~/Screenshots
defaults write com.apple.screencapture location ~/Screenshots
# Show all hidden files (like dotfiles)
defaults write com.apple.finder AppleShowAllFiles YES; killall Finder;
@ndelage
ndelage / secret_keys_open_source.md
Last active December 25, 2015 19:09
Managing Secret Data in Open Source Applications

Managing Secret Data in Open source Applications

If you're working on an open source project, committing API keys or secrets to your repo is a big no-no. You wouldn't want anyone else making request with your keys, right?

So instead of putting those keys in app/config/initializers set then as environment variables in your shell. Here's an example for a Facebook API key:

export FB_API_KEY=3629346238763284623874623
@labe
labe / README.md
Last active December 23, 2015 23:09
cookies and ovens and bakers and more!

##Getting started

  • Fork this gist
  • Clone your forked copy onto your local machine
  • Open the files in your text editor
  • $ ruby tests.rb

##Procedure

  • Read the error message
@davidchambers
davidchambers / relative-timestamps.coffee
Created November 1, 2012 15:26
Relative timestamp formatting for jQuery.localize
{abs, floor, round} = Math
# > @localize = (timestamp) ->
# . $.localize.format (new Date timestamp), new Date "1 Mar 2012 00:30:45"
#
# > localize "30 Jan 2012 23:59:59"
# "2012-01-30"
# > localize "31 Jan 2012 00:00:00"
# "30 days ago"
# > localize "28 Feb 2012 23:59:59"
@JoshCheek
JoshCheek / README.md
Last active May 2, 2021 19:44
Challenge to create your own struct

This is a response for one of our apprentices who wanted to learn more about how structs work.

TL;DR

Part of this is a response and part of it a challenge. If you are only interested in the challenge clone the repo and run rake (more detailed instructions here).

Introduction

@zhengjia
zhengjia / capybara cheat sheet
Created June 7, 2010 01:35
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')