Skip to content

Instantly share code, notes, and snippets.

View tatums's full-sized avatar
✌️
Conway

Tatum Szymczak tatums

✌️
Conway
View GitHub Profile
## History file configuration
[ -z "$HISTFILE" ] && HISTFILE="$HOME/.zsh_history"
[ "$HISTSIZE" -lt 50000 ] && HISTSIZE=50000
[ "$SAVEHIST" -lt 10000 ] && SAVEHIST=10000
## History command configuration
setopt extended_history # record timestamp of command in HISTFILE
setopt hist_expire_dups_first # delete duplicates first when HISTFILE size exceeds HISTSIZE
setopt hist_ignore_dups # ignore duplicated commands history list
setopt hist_ignore_space # ignore commands that start with space
@tatums
tatums / slim-to-html.rb
Created December 20, 2019 21:03
A script to convert a slim template to good ol' HTML
require "slim"
require 'fileutils'
# allows single line html element followed by {{}} tags
Slim::Engine.set_options :attr_list_delims => {'(' => ')', '[' => ']'}
def convert(file, destination)
s = File::open(file).read()
t = Slim::Template.new({pretty: true}) { |x| s }
@tatums
tatums / index.html
Created December 19, 2017 15:28
conditional required form fields in angularjs
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Hello World!</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.9/angular.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/foundation/5.4.7/css/foundation.min.css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/foundation/5.4.7/js/foundation.min.js"></script>
import { Component } from '@angular/core'
import template from './index.html'
@Component({
template: template
})
export class ScholasticaNavigation { }
@tatums
tatums / vim-on-heroku.sh
Created August 24, 2017 18:09 — forked from sfate/vim-on-heroku.sh
vim on heroku
#!/usr/bin/env bash
curl https://s3.amazonaws.com/heroku-jvm-buildpack-vi/vim-7.3.tar.gz --output vim.tar.gz
mkdir vim && tar xzvf vim.tar.gz -C vim
export PATH=$PATH:/app/vim/bin
@tatums
tatums / R2G_to_local.md
Created August 22, 2017 16:11 — forked from mmcdaris/R2G_to_local.md
Replicate from REDISTOGO to your local machine

example RTG_URL: redis://username:[email protected]:9555/

Step 1: Start a local redis-server and redis-cli

$ redis-server
#in a new tab run:
$ redis-cli
@tatums
tatums / README.md
Last active July 11, 2018 08:16 — forked from brandt/README.md
Creates a loopback alias with IP 10.254.254.254 at startup on Mac OS X

Loopback Alias

Creates an alias on the loopback interface (lo0) with the IP 10.254.254.254 on Mac OS X.

Installation

  1. Install the plist to: /Library/LaunchDaemons/com.runlevel1.lo0.10.254.254.254.plist
  2. Set mode: chmod 0644 /Library/LaunchDaemons/com.runlevel1.lo0.10.254.254.254.plist
  3. Set owner: sudo chown root:wheel /Library/LaunchDaemons/com.runlevel1.lo0.10.254.254.254.plist
  4. Load: sudo launchctl load /Library/LaunchDaemons/com.runlevel1.lo0.10.254.254.254.plist
@tatums
tatums / uri.js
Created March 8, 2017 03:18 — forked from jlong/uri.js
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@tatums
tatums / capybara cheat sheet
Created February 10, 2017 23:08 — forked from zhengjia/capybara cheat sheet
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')
@tatums
tatums / .vimrc
Last active February 9, 2017 02:26 — forked from simonista/.vimrc
A basic .vimrc file that will serve as a good template on which to build.
" Don't try to be vi compatible
set nocompatible
" Helps force plugins to load correctly when it is turned back on below
filetype off
" TODO: Load plugins here (pathogen or vundle)
" Turn on syntax highlighting
syntax on