Skip to content

Instantly share code, notes, and snippets.

View sadasant's full-sized avatar
👁️

Daniel Rodríguez sadasant

👁️
View GitHub Profile
@sadasant
sadasant / LICENSE
Last active August 29, 2015 13:56 — forked from ghostbar/LICENSE
Copyright © 2014 Jose Luis Rivas
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
#Refer: http://www.linuxfoundation.org/collaborate/workgroups/networking/netem#Delaying_only_some_traffic
#Refer: http://www.bomisofmab.com/blog/?p=100
#Refer: http://drija.com/linux/41983/simulating-a-low-bandwidth-high-latency-network-connection-on-linux/
#Setup the rate control and delay
sudo tc qdisc add dev lo root handle 1: htb default 12
sudo tc class add dev lo parent 1:1 classid 1:12 htb rate 56kbps ceil 128kbps
sudo tc qdisc add dev lo parent 1:12 netem delay 200ms
#Remove the rate control/delay
sudo tc qdisc del dev lo root
// UTF8 Module
//
// Cleaner and modularized utf-8 encoding and decoding library for javascript.
//
// copyright: MIT
// author: Nijiko Yonskai, @nijikokun, nijikokun@gmail.com
(function (name, definition, context, dependencies) {
if (typeof context['module'] !== 'undefined' && context['module']['exports']) { if (dependencies && context['require']) { for (var i = 0; i < dependencies.length; i++) context[dependencies[i]] = context['require'](dependencies[i]); } context['module']['exports'] = definition.apply(context); }
else if (typeof context['define'] !== 'undefined' && context['define'] === 'function' && context['define']['amd']) { define(name, (dependencies || []), definition); }
else { context[name] = definition.apply(context); }
@sadasant
sadasant / rb.rb
Created May 21, 2014 21:27 — forked from scalone/rb.rb
module T
def self.display
puts "display 1"
end
end
T.display
def T.display
puts "display 2"
@sadasant
sadasant / file_db.rb
Last active August 29, 2015 14:02 — forked from scalone/file_db.rb
class FileDb < Hash
attr_accessor :path
def initialize
super
end
def self.open(path)
f = self.new
@sadasant
sadasant / mrbc_fail.rb
Last active August 29, 2015 14:07 — forked from scalone/mrbc_fail.rb
# To compile `mrbc -o mrbc_fail.mrb mrbc_fail.rb`
class_decation_error T
def self.a
puts "aa"
end
end
@sadasant
sadasant / tdes.rb
Last active August 29, 2015 14:27 — forked from jinleileiking/tdes.rb
Ruby 3Des
require 'lib/ruby-des'
class TDES
class << self
def en_des plain, key
ret = ''
blocks = plain.scan(/.{16}/)
blocks.each do |block|
ret = ret + en_des_block(block, key)
end
@sadasant
sadasant / Resources
Created May 4, 2012 19:27 — forked from csanz/hackathons101.md
Hackathons 101
How to organize and run your own hackathon by Peter Moran: https://www.youtube.com/watch?v=1nk2zJ2GTkQ
var assert = require('assert')
/*
Fizzbuzz
*/
function FizzBuzz (number) {
if (number % 3 == 0 && number % 5 == 0) return 'fizzbuzz'
else if (number % 3 == 0) return 'fizz'
else if (number % 5 == 0) return 'buzz'
else return number

Getting command line tools on your Chromebook

If you want have some fun in the terminal with your new ARM Chromebook here's how to get a simple Arch Linux ARM chroot up and running. It assumes you already have your Chromebook in dev mode, if not google it before you continue.

This method requires no partitioning or other messing with your system, it just uses the fact that the /usr/local space is writable and persisted between upgrades.

First of, download http://archlinuxarm.org/os/ArchLinuxARM-imx6-latest.tar.gz

Open crosh with Ctrl+Alt+T