Skip to content

Instantly share code, notes, and snippets.

@alipio
alipio / web-servers.md
Created August 24, 2019 14:36 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@alipio
alipio / webpacker_rails.md
Created June 25, 2019 16:37 — forked from maxivak/webpacker_rails.md
Webpack, Yarn, Npm in Rails
@alipio
alipio / a_rails_rspec_checklist\README.md
Created April 25, 2019 00:27 — forked from BideoWego/a_rails_rspec_checklist\README.md
Rails Spec setup checklist, helper and support files

Rails RSpec Checklist

  • Ensure turbolinks is disabled for good measure

    • comment out gem
    • remove from javascript asset pipeline
    • remove from application layout
  • Add the following gems to Gemfile in a development, test group

  • hirb

@alipio
alipio / deliver_email_matcher.rb
Created April 18, 2019 16:21 — forked from masonforest/deliver_email_matcher.rb
rspec matcher for ActionMailer rails email delivery
# Usage
# order = create(:order)
#
# expect {
# order.pay!
# }.to deliver_email(OrderMailer, :paid, order.id)
#
#
@alipio
alipio / gitconfig.ini
Created April 15, 2019 10:39 — forked from tdd/gitconfig.ini
Nice, useful global Git configuration
# Put this in your ~/.gitconfig or ~/.config/git/config
# Windows users: "~" is your profile's home directory, e.g. C:\Users\<YourName>
[user]
name = Your Full Name
email = your@email.tld
[color]
# Enable colors in color-supporting terminals
ui = auto
[alias]
# List available aliases
package com.example.bank.impl;
import akka.Done;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CompletionStage;
import java.util.function.Consumer;
import java.util.function.Function;
import org.slf4j.Logger;
@alipio
alipio / gist:facb0dbc72d759667a5b5bcfceca1176
Created November 28, 2018 16:11 — forked from dreadatour/gist:7475747
Remove default Sublime Text 3 snippets
# Sublime Text 3 languages list:
ls -1 /Applications/Sublime\ Text.app/Contents/MacOS/Packages/
# Remove all default Sublime Text 3 snippets for Python language
export ST3_LANG="Python"
mkdir -p ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/$ST3_LANG/
unzip -l /Applications/Sublime\ Text.app/Contents/MacOS/Packages/$ST3_LANG.sublime-package | grep '.sublime-snippet' | awk '{print $4}' | while read f; do touch ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/$ST3_LANG/$f; done
unset ST3_LANG
@alipio
alipio / cleanup_rails_projects.rb
Created November 12, 2018 17:51 — forked from halloffame/cleanup_rails_projects.rb
Ruby script to clean up all the log and temp files in your rails projects.
# Running this file will clean up all of the temp files in your rails projects
# Instructions:
# 1. Save the file wherever you want
# 2. Replace the RAILS_PATH with the path to your rails projects
# 3. Run `ruby this_file_name.rb`
#
RAILS_PATH = '/replace/with/your/path/to/rails/projects'
require 'rake'
@alipio
alipio / rebase.md
Created October 17, 2018 16:57
Ultimate rebase-onto-master guide

Rebase "web-123-my-branch" onto master:

if you're the only person who is working on a branch...

$ git checkout web-123-my-branch # make sure you're on the right branch
$ git fetch # update remote refs
$ git rebase origin/master # perform the rebase onto the current state of master
  # for each conflict, edit file, resolve conflicts, git add -u <file>, git rebase --continue
$ git push -f origin web-123-my-branch # overwrite remote branch with newly rebase branch
@alipio
alipio / Gemfile
Created June 30, 2018 12:40 — forked from slatteryjim/Gemfile
Download all LingQ lessons for a given course, including all MP3 and text content.
source 'https://rubygems.org'
gem 'nokogiri'