Skip to content

Instantly share code, notes, and snippets.

@zrxq
zrxq / .lldbinit
Last active February 7, 2024 11:21
Execute lldb command and open its output in Sublime Text
comma script import ~/lldb/subl.py
comma script add -f subl.subl subl
@kerimdzhanov
kerimdzhanov / random.js
Last active May 3, 2026 02:39
JavaScript: get a random number from a specific range
/**
* Get a random floating point number between `min` and `max`.
*
* @param {number} min - min number
* @param {number} max - max number
* @return {number} a random floating point number
*/
function getRandomFloat(min, max) {
return Math.random() * (max - min) + min;
}
#!/usr/bin/env bash
apt-get -y update
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev
cd /tmp
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p374.tar.gz
tar -xvzf ruby-1.9.3-p374.tar.gz
cd ruby-1.9.3-p374/
./configure --prefix=/usr/local
make
make install
class Tree
attr_accessor :children, :node_name
def initialize(node_name, strucutre={})
@node_name = node_name
@children = []
strucutre.each_pair do |k,v|
@children.push(Tree.new(k,v))
end
end
#!/usr/bin/env ruby
$:.unshift(File.dirname(__FILE__) + "/../lib")
require "gist"
Gist.clear
Gist.process_selection
Gist.write(ARGV[0] == "private")