Skip to content

Instantly share code, notes, and snippets.

Balázs Kutil bkutil

Block or report user

Report or block bkutil

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@bkutil
bkutil / app.rb
Created Jan 28, 2017
tiny sinatra app for testing
View app.rb
#!/usr/bin/env ruby
require 'sinatra'
warn Process.pid
get '/' do
'hi'
end
View test.js
/* Generated by Opal 0.10.0.dev, indentation fixed manually */
/* source: a = true ? 2 : 0 rescue 10 */
(function(Opal) {
Opal.dynamic_require_severity = "error";
var OPAL_CONFIG = { method_missing: true, arity_check: false, freezing: true, tainting: true };
var $a, self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, a = nil;
return a = (function() {
try {
(function() {
@bkutil
bkutil / import
Last active Jul 6, 2016
Import ledger transactions to local elastic search instance
View import
#!/usr/bin/env ruby
require 'csv'
require 'elasticsearch'
require 'securerandom'
file = ARGV.shift
unless file
warn "Usage: $0 <ledger file>"
View bisect
#!/bin/bash
rm -rf $(pwd)/build
make clean
CFLAGS='-ggdb -g2 -gdwarf-2 -O0' ./configure --prefix=$(pwd)/build --disable-install-doc
make
make install
sudo ./build/bin/ruby -rsocket -e 'SIOCETHTOOL = 0x8946; i = ["lo", 10.chr].pack("a16p"); s = Socket.new(Socket::AF_INET, Socket::SOCK_DGRAM, 0); s.ioctl(SIOCETHTOOL, i); p i.unpack("a16p")[1]'
@bkutil
bkutil / gist:bbacd8e3d314721117d6
Created Feb 17, 2015
chybejici knihovny pri instalaci ruby
View gist:bbacd8e3d314721117d6
10:12 <qwebirc46419> LInux mint 17.1 , cista instalacia, ruby nainstalovane pomocou rbenv, verzia ruby 2.20, verzia rails 4.2.0, vytvorim novy projekt, spustim rails server a vyhodi chybu "6:
warning: already initialized constant APP_PATH", skusal som rozne riesenia, aj odinstalovat niektore gem, nepomohlo, skusal som prikaz "rake rails:update:bin", tiez bez
vysledku, , rake aborted ,LoadError: cannot load such file -- readline /home/blacknails/Doc
10:13 <qwebirc46419> a dalej sa neviem pohnut
10:14 <qwebirc46419> este raz cely vypis po rake rails:update:bin
10:14 <qwebirc46419> rake aborted! LoadError: cannot load such file -- readline /home/blacknails/Documents/PROJECTS/blog/config/application.rb:7:in `<top (required)>'
/home/blacknails/Documents/PROJECTS/blog/Rakefile:4:in `<top (required)>'
10:19 <bkutil> ruby ma zavislosti na -devel knihovnach - readline, openssl - mels je nainstalovane, kdyz jsi ho kompiloval?
10:19 <bkutil> https://gith
@bkutil
bkutil / Duinode.ino
Created Apr 7, 2014
Arduino sketch for duinode reporting voltage and temperature
View Duinode.ino
#include <SPI.h>
#include <avr/sleep.h>
#include "nRF24L01.h"
#include "RF24.h"
#include "printf.h"
RF24 radio(8, 7);
int led = 3;
int temp = A2;
View stub_method_visibility_name_clash_spec.rb
require 'spec_helper'
describe "A method stub" do
def decorate(klass, scope)
klass.class_eval <<-EOF
#{scope}
def some_stubbed_method
end
View sphere_shadow.js
var camera, scene, renderer;
var geometry, material, mesh;
init();
animate();
function init() {
camera = new THREE.PerspectiveCamera( 75, window.innerWidth / window.innerHeight, 1, 10000 );
camera.position.z = 300;
@bkutil
bkutil / ga.rb
Created Mar 18, 2013
Wrapper around Gabba to report events in background using Sidekiq's delay.
View ga.rb
class GA
def self.track(type, args, cookies = nil, request = nil)
begin
self.delay(:queue => :analytics).track_send(type, args, cookies, request)
rescue Redis::CannotConnectError => e
Rails.logger.error e.message + "\n" + e.backtrace.join("\n")
end
end
private
@bkutil
bkutil / Excel.php
Created Oct 2, 2012 — forked from ihumanable/Excel.php
Simple Excel Writer in PHP
View Excel.php
<?php
/**
* Simple excel writer class with no external dependencies, drop it in and have fun
* @author Matt Nowack
* @license Unlicensed
* @version 1.0
*/
class Excel {
private $col;
You can’t perform that action at this time.