Skip to content

Instantly share code, notes, and snippets.

View xaviervia's full-sized avatar

Fernando Via Canel xaviervia

View GitHub Profile
*DateTime> show (MkLocalDateTime (MkTimeZone "GMT" (MkOffset (+) (MkInstant (MkHour 1) (MkMin 30) (MkSec 0)))) (MkDateTime (MkDate (MkYear 1991) September (MkDay 28)) (MkInstant (MkHour 21) (MkMin 12) (MkSec 0))))
"1991-09-28T21:12:00+01:30" : String
*DateTime> MkLocalDateTime (MkTimeZone "GMT" (MkOffset (+) (MkInstant (MkHour 1) (MkMin 30) (MkSec 0)))) (MkDateTime (MkDate (MkYear 1991) September (MkDay 28)) (MkInstant (MkHour 21) (MkMin 12) (MkSec 0)))
MkLocalDateTime (MkTimeZone "GMT" (MkOffset (+) (MkInstant (MkHour 1) (MkMin 30) (MkSec 0))))
(MkDateTime (MkDate (MkYear 1991) September (MkDay 28)) (MkInstant (MkHour 21) (MkMin 12) (MkSec 0))) : LocalDateTime (MkTimeZone "GMT"
(MkOffset (+)
(MkI
@gcanti
gcanti / proof_in_functions.js
Created July 3, 2016 08:56
"Proof in functions" by @mbrandonw implemented in JavaScript and using Flow as a static type checker
// @flow
/*
"Proof in functions" by @mbrandonw
implemented in JavaScript and using Flow as a static type checker
Original post:
http://www.fewbutripe.com/swift/math/2015/01/06/proof-in-functions.html
@graceavery
graceavery / harryPotterAliases
Last active May 10, 2023 02:51
bash aliases for Harry Potter enthusiasts
alias accio=wget
alias avadaKedavra='rm -f'
alias imperio=sudo
alias priorIncantato='echo `history |tail -n2 |head -n1` | sed "s/[0-9]* //"'
alias stupefy='sleep 5'
alias wingardiumLeviosa=mv
alias sonorus='set -v'
alias quietus='set +v'
@agnoster
agnoster / README.md
Last active April 6, 2024 22:35
My ZSH Theme

agnoster.zsh-theme

A ZSH theme optimized for people who use:

  • Solarized
  • Git
  • Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)

For Mac users, I highly recommend iTerm 2 + Solarized Dark

@mashihua
mashihua / post-commit
Created June 19, 2012 07:34
Git commit hook for trello.com
#!/usr/bin/env node
//please requist your app token from
//https://trello.com/1/connect?key=yourkey&name=git-hook&expiration=never&response_type=token&scope=read,write
var key = "your key";
var token = "your token";
//https://trello.com/board/-/4e9003324a517dad44465056
var board_id = "4e9003324a517dad44465056";
var Trello = require("node-trello");
@burningTyger
burningTyger / patch.md
Created March 21, 2012 14:14
Using PATCH in Rack::Test

In case you want to use the PATCH verbin Rack::Test and you get errors when you try it with the current gem release you will have to use the git version in your Gemfile:

group :test do
  gem 'rack-test', :git => "https://github.com/brynary/rack-test.git"

While the PATCH verb has been included in a recent patch it's not yet in the gem release. Using the :git repo lets you test also PATCH routes for your rack app.

@Simbul
Simbul / pre-commit
Created February 9, 2012 18:06
Git hook to prevent commits on a staging/production branch
#!/usr/bin/env ruby
# This pre-commit hook will prevent any commit to forbidden branches
# (by default, "staging" and "production").
# Put this file in your local repo, in the .git/hooks folder
# and make sure it is executable.
# The name of the file *must* be "pre-commit" for Git to pick it up.
FORBIDDEN_BRANCHES = ["staging", "production"]
@epitron
epitron / blackcarpet.rb
Created January 30, 2012 22:30
BlackCarpet (ANSI renderer for RedCarpet)
require 'epitools'
require 'redcarpet'
require 'coderay'
def indented?(text)
indent_sizes = text.lines.map{ |line| if line =~ /^(\s+)/ then $1 else '' end }.map(&:size)
indent_sizes.all? {|dent| dent > 0 }
end
def unwrap(text)
@sapegin
sapegin / bem.css
Created December 15, 2011 08:41
BEM in Stylus
.foo {
color: #f00;
}
.foo__bar {
color: #00f;
}
@lbj96347
lbj96347 / iScroll-Pull-to-Refresh.html
Created November 12, 2011 13:26
iScroll Pull to Refresh.
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<title>iScroll demo: simple</title>