Skip to content

Instantly share code, notes, and snippets.

View meal's full-sized avatar
🚀

Mateusz Kozak meal

🚀
View GitHub Profile
@meal
meal / robot.js
Created December 4, 2012 13:17
Robotron
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
};
Robot.prototype.onIdle = function(ev) {
@meal
meal / robot.js
Created December 4, 2012 14:14 — forked from pveras/robot.js
ASIMO
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
@meal
meal / robot.js
Created December 4, 2012 14:49
notb
//FightCode can only understand your robot
//if its class is called Robot
var friends = {}, id;
var Robot = function(robot) {
id = robot.id;
// friends is the set all friendly robots
friends[id] = id;
clone = robot.clone();
@meal
meal / gist:5765332
Created June 12, 2013 13:40
ruby wrapper gc patched
export PATH ; PATH="/usr/local/rvm/gems/ruby-1.9.3-p429/bin:/usr/local/rvm/gems/ruby-1.9.3-p429@global/bin:/usr/local/rvm/rubies/ruby-1.9.3-p429/bin:/usr/local/rvm/bin:$PATH"
export rvm_env_string ; rvm_env_string='ruby-1.9.3-p429'
export rvm_path ; rvm_path='/usr/local/rvm'
export rvm_ruby_string ; rvm_ruby_string='ruby-1.9.3-p429'
unset rvm_gemset_name
export RUBY_VERSION ; RUBY_VERSION='ruby-1.9.3-p429'
export GEM_HOME ; GEM_HOME='/usr/local/rvm/gems/ruby-1.9.3-p429'
export GEM_PATH ; GEM_PATH='/usr/local/rvm/gems/ruby-1.9.3-p429:/usr/local/rvm/gems/ruby-1.9.3-p429@global'
export MY_RUBY_HOME ; MY_RUBY_HOME='/usr/local/rvm/rubies/ruby-1.9.3-p429'
export IRBRC ; IRBRC='/usr/local/rvm/rubies/ruby-1.9.3-p429/.irbrc'
+__rvm_parse_args:652> [[ -n 4.3.11 ]]
+__rvm_parse_args:689> [[ -z info ]]
+__rvm_parse_args:692> [[ error == info || 0 -eq 1 || -n '' ]]
+__rvm_parse_args:16> [[ -n list ]]
+__rvm_parse_args:18> rvm_token=list
+__rvm_parse_args:20> (( 0 > 0 ))
+__rvm_parse_args:25> next_token=''
+__rvm_parse_args:28> case list ([[:alnum:]]*|@*)
+__rvm_parse_args:31> case list (use)
+__rvm_parse_args:31> case list (install|uninstall|reinstall|try_install)
@meal
meal / devise rspec
Created December 30, 2013 18:16
devise rspec
/Users/meal/.rvm/gems/ruby-2.0.0-p247/gems/devise-3.2.2/lib/devise/rails/routes.rb:469:in `raise_no_secret_key': Devise.secret_key was not set. Please add the following to your Devise initializer: (RuntimeError)
config.secret_key = '075fae100c96155d95773fadfea48eac44a126d732bcaadb6abadf202358fb6513f44dd7f1b651b4dc2dbaa2598aa3aa447fc1cb0a6d4bea8b3a95be635fa6fa'
Please ensure you restarted your application after installing Devise or setting the key.
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/socket.h>
#include <bluetooth/bluetooth.h>
#include <bluetooth/hci.h>
#include <bluetooth/hci_lib.h>
int main(int argc, char **argv)
{
┌─[meal@air] - [~] - [Tue Oct 14, 02:07]
└─[$] <> gem install nokogiri --no-ri --no-rdoc
Fetching: mini_portile-0.6.0.gem (100%)
Successfully installed mini_portile-0.6.0
Fetching: nokogiri-1.6.3.1.gem (100%)
Building native extensions. This could take a while...
Building nokogiri using packaged libraries.
Building libxml2-2.8.0 for nokogiri with the following patches applied:
- 0001-Fix-parser-local-buffers-size-problems.patch
- 0002-Fix-entities-local-buffers-size-problems.patch
{
"color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme",
"ensure_newline_at_eof_on_save": true,
"font_face": "Monaco",
"font_size": 12,
"ignored_packages":
[
"Handlebars",
"Theme - Nexus",
"Vintage"
1.9.3-p551 :005 > Benchmark.bm{|x| x.report { sleep(RUBY_VERSION.to_f) } }
user system total real
0.000000 0.000000 0.000000 ( 1.900123)
2.1.5 :002 > Benchmark.bm{|x| x.report { sleep(RUBY_VERSION.to_f) } }
user system total real
0.000000 0.000000 0.000000 ( 2.100181)