Skip to content

Instantly share code, notes, and snippets.

View makevoid's full-sized avatar

Francesco 'makevoid' Canessa makevoid

View GitHub Profile
@masak
masak / explanation.md
Last active January 2, 2026 04:27
How is git commit sha1 formed

(The below text is licensed with CC0, which means that if you want to use or translate it, that is OK by me.)

Ok, I geeked out, and this is probably more information than you need. But it completely answers the question. Sorry. ☺

Locally, I'm at this commit:

$ git show
commit d6cd1e2bd19e03a81132a23b2025920577f84e37
Author: jnthn <jnthn@jnthn.net>

Date: Sun Apr 15 16:35:03 2012 +0200

Routing in Ember

In Ember, the application's state manager handles routing. Let's take a look at a simple example:

App.stateManager = Ember.StateManager.create({
  start: Ember.State.extend({
    index: Ember.State.extend({
      route: "/",
@spleenteo
spleenteo / clearfix.scss
Created June 3, 2012 00:57
clearfix in scss
.clearfix {
display: block;
&:after {
clear: both;
content: ' ';
display: block;
font-size: 0;
line-height: 0;
visibility: hidden;
width: 0;
@maccman
maccman / juggernaut.rb
Created June 26, 2012 02:49
Sinatra Server Side Event streaming.
# Usage: redis-cli publish message hello
require 'sinatra'
require 'redis'
conns = []
get '/' do
erb :index
end
@Angles
Angles / some iOS browser URI launching JS snippets.js
Last active August 2, 2024 07:38
"Open In" Bookmarklets for iOS
/* WITH MODS TO ORIG -- iOS Browser Bookmarklets to launch other apps and stuff */
/* ver 2014-04-14a */
/* backing up my "Open In" bookmarks */
// note iOS6 requires some changes to these
// BEGIN TESTING STUFF -- IN PROFRESS LIKELY NOT WORKING
// SOME WORK, MOST tests are not WORK --
// PINNER APP TEST STUFF (as a private one)
// the page title as the title and your selected text as the description.
# encoding: binary
# Removes any bytes from a string that are not valid UTF-8
class Cleaner
attr_reader :bytes, :buffer, :outstanding
def self.clean(str)
new.tap { |c| c << str }.to_s
end
@ezmobius
ezmobius / gist:3686235
Created September 9, 2012 18:20
mendelmax slic3r config
# generated by Slic3r 0.9.0 on Sun Sep 9 11:01:56 2012
acceleration = 0
bed_size = 220,280
bed_temperature = 0
bridge_fan_speed = 100
bridge_flow_ratio = 1
bridge_speed = 70
brim_width = 0
complete_objects = 0
cooling = 1
@jballanc
jballanc / gist:4004243
Created November 2, 2012 20:55
MacRuby 1.0 vs RubyMotion for OS X

MacRuby Currently

  • Implements ~90% of Ruby functionality with some bugs
  • Can be used to create OS X desktop applications
  • Integrates with XCode
  • Uses the Obj-C GC (deprecated)

MacRuby 1.0

  • Fix known Ruby compatibility bugs
@gr2m
gr2m / payments_dreamcode.js
Last active April 29, 2024 19:17
Imagine you could purchase items from your store, with pure JavaScript in the browser. How would it look like? Here's what I came up with. Forks & comments much appreciated! #nobackend #dreamcode
// purchase a product with a credit card
purchase('productId')
.using( {
cc: "4556934156210213",
valid: "2016-10",
csc: "123"
} )
// purchase a product with paypal
purchase('productId')
@Sjors
Sjors / bitcoin-pay.rb
Last active April 9, 2024 16:50
This script demonstrates how a bitcoin transaction is created and signed. Just pass in your own address and private key and it will prepare a transaction for you. You can then copy & paste that transaction into a webservice like Blockchain to send it. I wrote this mostly to understand better how it works. I sometimes had to "cheat" and look at t…
#!/usr/bin/env ruby
require 'open-uri'
require 'JSON'
require 'digest/sha2'
require 'pry'
require 'bigdecimal'
require 'bitcoin' # Because I need to cheat every now and then
# Usage:
# gem install pry json ffi ruby-bitcoin