Skip to content

Instantly share code, notes, and snippets.

View nrk's full-sized avatar
🤔
はい、猫のように見えます。

Daniele Alessandri nrk

🤔
はい、猫のように見えます。
View GitHub Profile
import scala.xml._
def googleLocalisation(adr: String) : Option[(Double, Double)] = {
val url = "http://maps.google.com/maps/api/geocode/xml?sensor=false&address="
val xml = XML.load(url+adr)
if ((xml \ "status" text) == "OK") {
val lat = ((xml \ "result" \ "geometry" \ "location" \ "lat") text).toDouble
val lng = ((xml \ "result" \ "geometry" \ "location" \ "lng") text).toDouble
Some((lat, lng))
} else {
#! /bin/sh
### BEGIN INIT INFO
# Provides: redis-server
# Required-Start: $syslog
# Required-Stop: $syslog
# Should-Start: $local_fs
# Should-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: redis-server - Persistent key-value db
@endolith
endolith / Has weird right-to-left characters.txt
Last active April 29, 2025 03:07
Unicode kaomoji smileys emoticons emoji
ּ_בּ
בּ_בּ
טּ_טּ
כּ‗כּ
לּ_לּ
מּ_מּ
סּ_סּ
תּ_תּ
٩(×̯×)۶
٩(̾●̮̮̃̾•̃̾)۶
# Function to print hierarchical call trees as the program executes.
# Use "ir.exe -trace" for IronRuby
$CALL_DEPTH = 0
p = proc { |op, file, line, method, b, cls|
if op == "call"
filename = file.nil? ? nil : file.gsub('\\','/')
puts "#{$CALL_DEPTH}\t" + ('| ' * $CALL_DEPTH) + "> #{cls}::#{method} #{filename}:#{line}"
locals = eval("local_variables", b)
local_values = locals.each { |l|