Skip to content

Instantly share code, notes, and snippets.

View bkutil's full-sized avatar

Balázs Kutil bkutil

View GitHub Profile
@bkutil
bkutil / gist:bbacd8e3d314721117d6
Created February 17, 2015 10:54
chybejici knihovny pri instalaci ruby
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
#!/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:2205462
Created March 26, 2012 14:26
A testing gist for embedding into the bootstrap theme for octopress
#include <stdio.h>
int main(void)
{
printf("Hello, world!\n");
return 0;
}
@bkutil
bkutil / dead_models.rb
Created August 24, 2012 08:39
Simple script for scanning a file for possible model references, then filtering out those which no longer exist in app/models.
#!/usr/bin/env ruby
require 'rubygems'
require 'machete'
rails_root = ARGV[0]
file = ARGV[1]
if rails_root.nil? || !File.exists?(rails_root) || file.nil? || !File.exists?(file)
warn "Usage: dead_models <rails root> <source file>"
@bkutil
bkutil / Excel.php
Created October 2, 2012 17:15 — forked from ihumanable/Excel.php
Simple Excel Writer in 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;
@bkutil
bkutil / ga.rb
Created March 18, 2013 08:56
Wrapper around Gabba to report events in background using Sidekiq's delay.
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
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 / Duinode.ino
Created April 7, 2014 08:07
Arduino sketch for duinode reporting voltage and temperature
#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;
require 'spec_helper'
describe "A method stub" do
def decorate(klass, scope)
klass.class_eval <<-EOF
#{scope}
def some_stubbed_method
end
@bkutil
bkutil / import
Last active July 6, 2016 13:34
Import ledger transactions to local elastic search instance
#!/usr/bin/env ruby
require 'csv'
require 'elasticsearch'
require 'securerandom'
file = ARGV.shift
unless file
warn "Usage: $0 <ledger file>"