Skip to content

Instantly share code, notes, and snippets.


Sergio Diaz kisai

  • Mexico
View GitHub Profile
kisai / github-window-fit.css
Created Mar 3, 2019
CSS for stylus extension to make Github fit smaller windows
View github-window-fit.css
@-moz-document domain(""), domain(""), regexp("^https?://((blog|gist|guides|help|raw|resources|status|developer)\\.)?github\\.com/((?!generated_pages/preview).)*$") {
body {
min-width: auto !important;
.container {
transition: width 0.2s;
.container {
View sass_and_less_compared.markdown

Sass/Less Comparison

In this document I am using Sass's SCSS syntax. You can choose to use the indented syntax in sass, if you prefer it, it has no functional differences from the SCSS syntax.

For Less, I'm using the JavaScript version because this is what they suggest on the website. The ruby version may be different.


kisai / hangman.hs
Created Oct 7, 2015 — forked from ToJans/hangman.hs
A haskell implementation of the hangman game
View hangman.hs
import Control.Monad (when)
import Data.Char (toLower)
import Data.List (transpose)
import System.Random (randomIO)
wordsPath :: FilePath
wordsPath = "words.txt"-- "/usr/share/dict/words"
data GameState = GameState
{ _wordToGuess :: String
kisai / mac.bash
Created Aug 27, 2015
Remove annoying mac bouncing of icons
View mac.bash
defaults write no-bouncing -bool TRUE
killall Dock
kisai / hiccup-style.clj
Created Dec 9, 2014
Extend hiccup syntax for css style attribute
View hiccup-style.clj
;; taken from
(defn style [& info]
{:style (.trim (apply str (map #(let [[kwd val] %]
(str (name kwd) " " val "; "))
(apply hash-map info))))})
kisai / singleton_method.rb
Created Sep 18, 2014
Define a singleton method for a ruby object
View singleton_method.rb
class A
class << self
def class_name
A.define_singleton_method(:who_am_i) do
"I am: #{class_name}"
kisai / convert_object_to_hash.rb
Created Sep 12, 2014
Convert object to hash in ruby
View convert_object_to_hash.rb
class Gift
def initialize
@name = "book"
@price = 15.95
gift =
hash = {}
gift.instance_variables.each {|var| hash[var.to_s.delete("@")] = gift.instance_variable_get(var) }
bundle config --with-pg-config=/path/to/pg_config
View gen_rsa_key_from_modulus.rb
require 'openssl'
require 'base64'
rsa =
modulus = rsa.n
exponent = rsa.e
oid ="rsaEncryption")
alg_id =[oid,])