Skip to content

Instantly share code, notes, and snippets.

View marcelosomers's full-sized avatar

Marcelo Somers marcelosomers

View GitHub Profile
@marcelosomers
marcelosomers / SassMeister-input.scss
Created May 30, 2014 15:27
Generated by SassMeister.com.
// ----
// Sass (v3.3.7)
// Compass (v1.0.0.alpha.18)
// ----
// _configuration.scss
$base-path: '../bundles/assets/';
$image-path: $base-path + 'images/';
$font-path: $base-path + 'fonts/';
@marcelosomers
marcelosomers / tup.sh
Created January 24, 2014 15:03
Bash script to open a new terminal window in the existing window's directory
#!/bin/sh
# Stolen from stackoverflow.com/questions/1589114/opening-a-new-terminal-tab-in-osxsnow-leopard-with-the-opening-terminal-window
# Add as a file named `tup` somewhere on your $PATH (e.g., ~/bin
pwd=`pwd`
osascript -e "tell application \"Terminal\"" \
-e "tell application \"System Events\" to keystroke \"t\" using {command down}" \
-e "do script \"cd $pwd; clear\" in front window" \
-e "end tell"
> /dev/null
@marcelosomers
marcelosomers / gist:8524345
Created January 20, 2014 17:14
Parsing JSON in Ruby
<% json = File.read("data/data.json")
data = JSON.parse(json) %>
<ul>
<% data.each do |d| %>
<li><a href="<%= d["email"] %>"><%= d["name"] %></a></li>
<% end %>
</ul>
@marcelosomers
marcelosomers / git-php-webhook.php
Last active January 28, 2023 19:07
A basic webhook for deploying updates to repos on Github to your local server
<?php
/**
* This script is for easily deploying updates to Github repos to your local server. It will automatically git clone or
* git pull in your repo directory every time an update is pushed to your $BRANCH (configured below).
*
* Read more about how to use this script at http://behindcompanies.com/2014/01/a-simple-script-for-deploying-code-with-githubs-webhooks/
*
* INSTRUCTIONS:
* 1. Edit the variables below
* 2. Upload this script to your server somewhere it can be publicly accessed
@marcelosomers
marcelosomers / serve-gemfile
Created December 20, 2013 00:52
My base gemfile for serve (http://get-serve.com/)
source 'https://rubygems.org'
gem 'serve', '1.5.2'
# TryStatic
gem 'rack-contrib'
# Use Compass and Sass
gem 'compass'
gem 'guard-livereload'
@marcelosomers
marcelosomers / serve-guardfile
Last active December 31, 2015 00:08
A base guardfile for using guard-livereload on Serve (http://get-serve.org/)
# A Guardfile for Serve (http://get-serve.org/)
guard 'livereload' do
watch(%r{views/.+\.(erb|haml|slim)$})
watch(%r{public/.+\.(css|js|html)})
watch(%r{stylesheets/.+\.(scss|sass)})
end
@marcelosomers
marcelosomers / new_laptop_setup.md
Last active December 27, 2015 12:09
New Mac Set Up