This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'exifr' | |
data = Dir.glob("photos/*.jpg").collect do |file| | |
{ | |
:file => file, | |
:time => EXIFR::JPEG.new(file).date_time, | |
} | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Returns the utf string corresponding to the unicode value (from php.net, courtesy - [email protected]) | |
function code2utf($num) | |
{ | |
if ($num < 128) return chr($num); | |
if ($num < 2048) return chr(($num >> 6) + 192) . chr(($num & 63) + 128); | |
if ($num < 65536) return chr(($num >> 12) + 224) . chr((($num >> 6) & 63) + 128) . chr(($num & 63) + 128); | |
if ($num < 2097152) return chr(($num >> 18) + 240) . chr((($num >> 12) & 63) + 128) . chr((($num >> 6) & 63) + 128) . chr(($num & 63) + 128); | |
return ''; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function array_to_rows($array, $cols, $complete = true) | |
{ | |
$rows = array_chunk($array, $cols); | |
$last = count($rows) - 1; | |
if (!$complete || $last < 0) | |
return $rows; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Float | |
# Convert decimal to degrees, minutes, seconds sexagesimal | |
# (used for GPS coordinates) | |
def to_sexagesimal | |
degrees = abs.floor | |
x = (abs - degrees) * 60 | |
minutes = x.floor | |
seconds = (((x - minutes) * 60) * 100).round.to_f / 100 | |
sign = self < 0 ? '-' : '' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
# |
NewerOlder