Skip to content

Instantly share code, notes, and snippets.

View mokagio's full-sized avatar
Building stuff

Gio Lodi mokagio

Building stuff
View GitHub Profile
mokagio / sticky.css
Created February 26, 2012 20:53
Twitter Bootstrap + Sticky Footer + Fixed Nav Bar
html, body, .container, .content {
height: 100%;
.container, .content {
position: relative;
.proper-content {
padding-top: 40px; /* >= navbar height */
// IPInsetLabel.h
// Instapaper
// Created by Marco Arment on 7/23/11.
// Copyright 2011 Instapaper LLC, released to the public domain.
#import <UIKit/UIKit.h>
mokagio / Guardfile
Created March 5, 2013 21:44 — forked from l4u/Guardfile
guard :shell do
watch(%r{-hd\.png$}) do |m|
input = m[0]
output = input.gsub(/-hd.png$/,'.png')
puts "Downsizing #{input} to #{output}"
`convert #{input} -resize 50% #{output}`
mokagio / MCSpriteLayer.h
Created May 21, 2013 22:08
MCSpriteLayer, core component to create sprite sheet based animation. See
#import <QuartzCore/QuartzCore.h>
@interface MCSpriteLayer : CALayer {
unsigned int sampleIndex;
@property (readwrite, nonatomic) unsigned int sampleIndex;
mokagio / .gitignore
Last active December 17, 2015 20:19
.gitignore for advanced Objective-C workflow with CocoaPods and AppCode
# OSX stuff
# Xcode
mokagio / unicode_symbols.rb
Created September 3, 2013 14:33
Useful unicode characters for Ruby scripts
cross = "\u2718" # => ✘
love = "\u2665" # => ♥
tick = "\u2714" # => ✔
warning = "\u26A0" # => ⚠
mokagio /
Created June 27, 2014 10:32
Magic is a language for making and doing powerful things. Like coding!

“Yes, brisingr. ” The fire flared, and a shiver ran through Eragon. Something about the word made him feel incredibly alive. “I thought so. Brisingr is from an ancient language that all living things used to speak. However, it was forgotten over time and went unspoken for eons in Alagaësia, until the elves brought it back over the sea. They taught it to the other races, who used it for making and doing powerful things. The language has a name for everything, if you can find it.” “But what does that have to do with magic?” interrupted Eragon. “Everything! It is the basis for all power. The language describes the true nature of things, not the superficial aspects that everyone sees. For example, fire is called brisingr . Not only is that a name for fire, it is the name for fire. If you are strong enough, you can use brisingr to direct fire to do whatever you will.

From Eragon by Christopher Paolini

mokagio / pre-commit
Created July 15, 2014 23:49
A git pre-commit hook to remove trailing whitespaces
# #!/bin/bash
# git hook script to find and fix trailing whitespace
# in your commits. Bypass it with the --no-verify option
# to git-commit
# usage: make a soft link to this file, e.g., ln -s ~/config/ ~/some_project/.git/hooks/pre-commit
# credits:
# An example hook script to verify what is about to be committed.
# Called by "git commit" with no arguments. The hook should
# exit with non-zero status after issuing an appropriate message if
# it wants to stop the commit.
# Purposes:
# Add an empty line at the end of the file.
# Remove trailing spaces at the end of a line.
mokagio / gist:589a91a929ed79cb7686
Last active August 29, 2015 14:10
HipChat wishlist

Note: the following UX is from the Mac app only

  1. Direct download of attachments OR open in browser, at the moment when an attachment is opened the browser opens, but only to start the download.
  2. Markdown like syntax parsing, so _ italic _, ** bold **, and code can be used
  3. compatibility (yep some of them might be competitors but it's almost a standard)