Skip to content

Instantly share code, notes, and snippets.

@laurynas
laurynas / knedliku_teorija.txt
Created June 23, 2014 14:02
Knedlikų teorija
https://web.archive.org/web/20050405113624/http://www.road.lt/keliautojai/am/pasakojimai/30/
Antanas Marcelionis
Vilnius – Valensija autostopu. Antroji dalis
2000 Spalis; Vokietija, Čekija
Juokingą atstumą nuo Prahos iki Vokietijos sienos įveikėme begėdiškai ilgai – užtrukome beveik visą dieną. Dykas buvimas pagimdė mūsų galvose istoriją apie KNIEDLIKUS. Mes maždaug žinojome, kad kniedlikai tai kažkokia nacionalinė čekiška bulka, tačiau nusprendėme, kad vistik tai yra nacionalis augalas. Ir prasidėjo.
KNIEDLIKŲ TEORIJA (galite tikėti, bet geriau ne)
#!/usr/bin/env ruby
# vim: set syntax=ruby
flag = false
files = `git diff --cached --name-only --diff-filter=ACM`.split("\n")
files.each do |file|
results = `git diff --cached #{file} | grep "^\+[^+]" | grep -e "binding.pry" -e "focus: true" -e ":focus => true" -e "console.log" -e "debugger"`.split("\n").map { |r| r.sub(/^\+[\s\t]*/, '') }
if $? == 0
@laurynas
laurynas / openelec-remote-setup.txt
Last active August 29, 2015 14:05
Openelec / XBMC Thomson remote setup
00131849 Thomson ROC 5112 Universal 5in1 Remote Control
https://de.hama.com/00131849/thomson-roc-5112-universal-5in1-remote-control
# Thomson universal remote setup, on remote:
# 1. Click and hold SETUP
# 2. Select DVD (TV or other)
# 3. Enter 1063 (@SAT, almost all keys send signal)
# The remote is programmed.
# Thomson remote notes:
@laurynas
laurynas / detectlanguage-batch.json
Created December 29, 2014 22:29
detectlanguage.com batch detection result example
{
"data":{
"detections":[
[
{
"language":"es",
"isReliable":true,
"confidence":10.24
}
],
using RestSharp;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication1
{
public class Detection
@laurynas
laurynas / tomtom_helper.rb
Created August 11, 2010 18:59
Generate "Add to TomTom" button
module TomTomHelper
# Generate Add To TomTom button
# You can pass following options hash:
# name - place name
# latitude - decimal latitude
# longitude - decimal longitude
# attribution - your attribution
# logo - link to your logo
#
@laurynas
laurynas / array_to_rows.php
Created August 12, 2010 13:51
PHP: array_to_rows
<?php
function array_to_rows($array, $cols, $complete = true)
{
$rows = array_chunk($array, $cols);
$last = count($rows) - 1;
if (!$complete || $last < 0)
return $rows;
@laurynas
laurynas / break_nonbreaking_space.php
Created August 31, 2010 09:56
Breaks long non-breaking string
<?php
/**
* Breaks long non-breaking string
*/
function break_nonbreaking($str, $max_length = 20, $breaker = ' ')
{
$max_length = (int)$max_length;
preg_match_all("/[^\s]{{$max_length},}/", $str, $m);
@laurynas
laurynas / rename_photos_by_date.rb
Created October 1, 2010 21:07
Renames all pictures in the folder using EXIF date/time
require 'rubygems'
require 'exifr'
data = Dir.glob("photos/*.jpg").collect do |file|
{
:file => file,
:time => EXIFR::JPEG.new(file).date_time,
}
end
@laurynas
laurynas / Blynai su bulviu padazu
Created October 25, 2010 12:53
Blynai su bulviu padazu
blynus tai reikia kepti is miltu, vandens, truputi pieno ir 1-2 kiausiniu
tesla turi buti gana skysta, kad dideli blynai iseitu
o padazui reikia isvirti bulviu
jas sutrinti
pakepti spirguciu
ir tada ta bulviu kose su gana nemazai pieno ir tais spirguciais pakepinti keptuveje
pieno reikia ipilti tiek, kad padazas butu ne sausas