Skip to content

Instantly share code, notes, and snippets.

View jesse-spevack's full-sized avatar

Jesse Spevack jesse-spevack

View GitHub Profile
@evanwalsh
evanwalsh / import.rb
Last active April 3, 2024 19:12
I imported my Jekyll from Squarespace's Wordpress XML with this
# coding: utf-8
require 'rubygems'
require 'hpricot'
require 'fileutils'
require 'safe_yaml'
require 'time'
module JekyllImport
# This importer takes a wordpress.xml file, which can be exported from your
##
# Creates an alias called "git hist" that outputs a nicely formatted git log.
# Usage is just like "git log"
# Examples:
# git hist
# git hist -5
# git hist <branch_name>
# git hist <tag_name> -10
##
git config --global alias.hist "log --pretty=format:'%C(yellow)[%ad]%C(reset) %C(green)[%h]%C(reset) | %C(red)%s %C(bold red){{%an}}%C(reset) %C(blue)%d%C(reset)' --graph --date=short"
@spiffytech
spiffytech / import.rb
Last active October 31, 2023 18:44 — forked from evanwalsh/import.rb
Imports a Squarespace dump into Jekyll
# coding: utf-8
require 'rubygems'
require 'hpricot'
require 'nokogiri'
require 'fileutils'
require 'safe_yaml'
require 'time'
require 'uri'
require 'open-uri'
@rwarbelow
rwarbelow / running_app_in_production_locally.markdown
Created November 11, 2015 18:26
How to Run a Rails App in Production Locally
  1. Add gem 'rails_12factor' to your Gemfile. This will add error logging and the ability for your app to serve static assets.
  2. bundle
  3. Run RAILS_ENV=production rake db:create db:migrate db:seed
  4. Run rake secret and copy the output
  5. From the command line: export SECRET_KEY_BASE=output-of-rake-secret
  6. To precompile your assets, run rake assets:precompile. This will create a folder public/assets that contains all of your assets.
  7. Run RAILS_ENV=production rails s and you should see your app.

Remember to clobber your assets (rake assets:clobber) and re-precompile (rake assets:precompile) if you make changes.

@eikes
eikes / run phoenix on amazon linux.sh
Created December 28, 2015 22:29
run phoenix on amazon linux
# app deps
sudo yum install git
# erlang deps
sudo yum groupinstall "Development Tools"
sudo yum install ncurses-devel
# erlang
wget http://www.erlang.org/download/otp_src_18.1.tar.gz
tar -zxvf otp_src_18.1.tar.gz
@mhawksey
mhawksey / getRowsData.gs
Created February 29, 2016 13:27
getRowsData and setRowsData - originally from the Google Apps Script developer site
// setRowsData fills in one row of data per object defined in the objects Array.
// For every Column, it checks if data objects define a value for it.
// Arguments:
// - sheet: the Sheet Object where the data will be written
// - objects: an Array of Objects, each of which contains data for a row
// - optHeadersRange: a Range of cells where the column headers are defined. This
// defaults to the entire first row in sheet.
// - optFirstDataRowIndex: index of the first row where data should be written. This
// defaults to the row immediately below the headers.
function setRowsData(sheet, objects, optHeadersRange, optFirstDataRowIndex) {
@techgaun
techgaun / erlang-elixir-on-amazon-linux.md
Last active November 21, 2023 03:09
Running elixir 1.8.1 on amazon linux

Script

#!/bin/bash

yum install ncurses-devel openssl-devel -y
yum groupinstall "Development Tools" -y

cd /tmp
wget "http://erlang.org/download/otp_src_21.3.tar.gz" -O otp21.tar.gz
@ryanflach
ryanflach / rails_setup.md
Last active November 13, 2023 19:49
Common setup for a new Rails project
  1. rails new <project_name> -d postgresql --skip-turbolinks --skip-spring -T
  • -d postgresql sets up the project to use PostgreSQL
  • --skip-turbolinks & --skip-spring creates a project that does not use turbolinks or spring
  • -T skips the creation of the test directory and use of Test::Unit
  1. In the Gemfile:
  • Available to all environments:
    • gem 'figaro' - store environment variables securely across your app (docs)
    • Uncomment gem 'bcrypt', '~> 3.1.7' if you will be hosting your own user accounts with passwords (docs)
  • Inside of group :test:
    • gem 'rspec-rails' - user rspec in place of minitest (docs)
@loilo
loilo / split-pull-requests.md
Last active April 3, 2024 07:24
Split a large pull request into two
Note: this assumes you are using ZSH shell.
## Installation
Install [asdf](https://github.com/asdf-vm/asdf):
```
$ git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.4.0
$ echo -e '\n. $HOME/.asdf/asdf.sh' >> ~/.zshrc
$ echo -e '\n. $HOME/.asdf/completions/asdf.bash' >> ~/.zshrc