Skip to content

Instantly share code, notes, and snippets.

module.exports = (grunt) ->
# configuration
grunt.initConfig
# grunt sass
sass:
compile:
options:
style: 'expanded'
@andrewboni
andrewboni / soundcloud.js
Created June 11, 2014 07:59
A Hexo blog plugin for embedding Soundcloud songs.
/**
* Soundcloud tag plugin
*
* Author: Andrew Boni
*
* Syntax:
* {% soundcloud <soundcloud song url> [type of player] %}
*
* Description:
* Embeds Soundcloud songs from a URL. Comes with an option to use the visual player or the default player. Possible
@jonsuh
jonsuh / gist:e93fbfbf994b5478d4bc
Last active November 6, 2015 09:23
Change Twitter’s Heart Animation to Exploding Poopies
.HeartAnimationContainer .HeartAnimation {
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAC1QAAABkCAYAAAA7MJAoAABZBElEQVR42uzBAQEAAACAkP6v7ggCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIDZgwMBAAAAACD/10ZQVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVXYuXuWKOAAjuP/paF3UO8gaAwJ90Ck1E49HygDL+ye8s5DF0kzMJCgGhxssMDFoRIqbPAp7zofwG5IaqkhagjaImhw/LdF0VbQqXw+b+G7/vjB/1cb6i4F9ECLA2B9dKBxdTTTGNg3VooXCwE9AAAAAAAAONzK7Q3HNy+dGd9OnDoW0IM/7PQ3na/1NyUCeqCHHmhxIJWLPaXHY6W4UuwbCeiBFvvccr6nupTvrQUAAAAAAADgcKukmi9UU83dgX1ha2JwrHItG7duDE4F9OA3cebOkZXJkXfLk8Mf9+5PHw3ogR56oMWB8yLd9nAp0/t5NZ1YDOiBFgAAAAAAAGDAS71VryYbXuaTn6r55PeNwa7Tgbp6kz53Ynm88PXB1ERcvD60t5vvOBnQg582My0L86Urca6Uj+V060JAD/TQAy0AAAAAAAAAAANe/sX2zeHF5zN349PpW3Hr9lg5UFeb2bbdR/2tca5QjPOpZKykW14H9ODX177b5Wzn20q2+/1auu1eQA/00AMtAAAAAAAAAMAbsgEvf2sn3dK+lOv6NltIxdnC5fgk1xtrA2c7AnWznkmkKrn2D6+G+p5t5Dq/rGUShYAeAAAAAMAP9u7npek4juP4hyAo+gfqTwi6RZDUSQJbufS7NbdpTTfS77bvvvsqbaBpP0AhITyUUIc6pUZ
require 'erb'
desc "build static files"
task :build do |t|
system "bundle exec jekyll build"
end
desc "push site content to the production environment"
task :push => [:build] do |t|
system "rsync -avz --delete _site/ USER@REMOTE:/var/www/rebuild.fm/htdocs/"
'use strict';
function leftpad1(str, len, ch) {
str = String(str);
var i = -1;
if (!ch && ch !== 0) ch = ' ';
len = len - str.length;
@yuki24
yuki24 / Gemfile
Last active April 16, 2016 20:05
Jbuilder is faster than Ralb.
source 'https://rubygems.org'
gem 'benchmark-ips'
gem 'activesupport'
gem 'jbuilder'
gem 'rabl'
gem 'oj'
@foxnewsnetwork
foxnewsnetwork / gist:622810064e340fd73ed4
Created May 19, 2015 18:49
Switching to Elixir Ecto from rails activerecord and dealing with timestamps

TL;DR, ActiveRecord's timestamps macro creates :created_at and :updated_at but Ecto's timestamps creates :inserted_at and :updated_at. If you already have a database setup and now want to switch from ActiveRecord rails to Ecto Elixir, you'll no doubt run into the following error:

(1054): Unknown column 'a0.inserted_at' in 'field list'

You can resolve this by going into your model file and making the following edit:

# models/appointments.ex
defmodule Appointment do
@etrepum
etrepum / dice.css
Last active September 29, 2016 18:23
Mission Bit Intro #8 - Dice Game
body {
background: linear-gradient(to top, green, black);
height: 100%;
background-repeat: no-repeat;
background-attachment: fixed;
margin: 0;
color: white;
}
div.game {
@kuatsure
kuatsure / slack-sidebar-theme--dracula
Last active November 28, 2016 21:36
Slack Sidebar Theme - Dracula
#282A36,#44475A,#FFB86C,#F8F8F2,#6272A4,#F8F8F2,#BD93F9,#FF5555
@noahlt
noahlt / killport.sh
Last active September 15, 2017 16:25
killport - kill whatever process is running on a given port
# add this to your .bash_profile to use it
# source: https://gist.github.com/noahlt/2662634
function killport {
if [ ! -n "$1" ] || [ $1 == '--help' ] || [ $1 == '-h' ]
then
echo '`killport <PORT>` finds the process listening to the specified port and kills it.'
else
process_line=`sudo lsof -i :$1 | tail -1`
if [ "$process_line" == "" ]
then