Skip to content

Instantly share code, notes, and snippets.

View mrcasals's full-sized avatar
👨‍🚀
🚀

Marc Riera mrcasals

👨‍🚀
🚀
View GitHub Profile
@mrsimo
mrsimo / hack.sh
Created April 4, 2012 08:34 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2299719/hack.sh | sh
#
@avdi
avdi / class-reloading.rb
Created June 12, 2012 19:08
Class reloading breaks type-checking
class Foo
end
Foo.object_id # => 34581480
f = Foo.new # => #<Foo:0x000000041f53c0>
f.class.object_id # => 34581480
# This just prevents the "const redefined" warning
@chriscoyier
chriscoyier / index.html
Created June 6, 2013 14:01
A CodePen by Chris Coyier. Track form progress with <progress> - Like a simple version of gamification.
<form accept-charset="UTF-8" action="#" class="pro-form" id="pro-form" method="post">
<h1>Progress Form</h1>
<div class="progress-wrap">
<progress max="100" value="0" id="progress"></progress>
<div class="progress-message" id="progress-message">The form, it wants you.</div>
</div>
<input id="subscription_plan_id" name="subscription[plan_id]" type="hidden" value="1">
@txus
txus / .pryrc.rb
Last active December 18, 2015 17:59
Pry command to trace a method invocation and log backtraces of each invocation to a file.
def write_backtrace name, backtrace, filename
exceptions = Regexp.union([
/\.bundle/,
/spec/,
/test/,
/lib\/ruby\/1.9.1/
])
backtrace.reject! { |line| line =~ exceptions }
@chriseidhof
chriseidhof / pechakucha.sh
Last active January 19, 2017 11:56
Advance Deckset slides every 20 seconds
#/bin/bash
# Works from Deckset 1.2 upwards. Make sure you have a document opened.
#
# If you're using the Trial version change "Deckset" to "Deckset Trial"
osascript -e 'repeat' -e 'tell application "Deckset" to tell document 1 to set slideIndex to slideIndex + 1' -e 'delay 20' -e 'end repeat'
@nihilismus
nihilismus / chruby-ruby-build-mksh.md
Last active January 30, 2017 01:30
chruby + ruby-build / mksh

chruby + ruby-build / mksh

  1. Install chruby and ruby-build with git. I keep their repo at ~/.chrb, their installation inside ~/local and my rubies at ~/.chrb/rubies.
  2. Copy this in your ~/.mkshrc file
# chruby + ruby-build
chrb() {
    source ~/local/share/chruby/chruby.sh
    unset RUBIES
    RUBIES=$(ls -d ~/.chrb/rubies/* 2> /dev/null)
@sztupy
sztupy / INSTALL.md
Last active April 4, 2018 07:49 — forked from namuol/INSTALL.md

rage-quit plugin for oh-my-zsh

based on rage-quit support for bash

HOW TO INSTALL

Put the files below inside ~/.oh-my-zsh/custom/plugins/fuck

Also chmod a+x the flip command.

@fxn
fxn / back.html
Last active March 16, 2020 09:02
<div class="card"><div class="content">{{Back}}</div></div>
@frontendbeast
frontendbeast / sm-annotated.html
Last active June 25, 2020 13:57 — forked from hdragomir/sm-annotated.html
The deferred font loading logic for Smashing Magazine, updated to include IE8 support. http://www.smashingmagazine.com/
<script type="text/javascript">
(function () {
"use strict";
// once cached, the css file is stored on the client forever unless
// the URL below is changed. Any change will invalidate the cache
var css_href = './index_files/web-fonts.css';
// a simple event handler wrapper
function on(el, ev, callback) {
if (el.addEventListener) {
el.addEventListener(ev, callback, false);
@otobrglez
otobrglez / Article.rb
Created July 12, 2011 20:51
Finding related articles using Jaccard index and tags
# This method finds related articles using Jaccard index (optimized for PostgreSQL).
# More info: http://en.wikipedia.org/wiki/Jaccard_index
class Article < ActiveRecord::Base
def related(limit=10)
Article.find_by_sql(%Q{
SELECT
a.*,
( SELECT array_agg(t.name) FROM taggings tg, tags t