Skip to content

Instantly share code, notes, and snippets.

@Kalyse
Kalyse / Get Current Metadata
Created February 4, 2014 21:28
Get Current Metadata
dbus-send --print-reply --session --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string:'Metadata'
method return sender=:1.185 -> dest=:1.2009 reply_serial=2
variant array [
dict entry(
string "mpris:artUrl"
variant string "http://open.spotify.com/thumb/2cc7b691baec4fde45591f1d8fc40e50ce25f817"
)
dict entry(
string "mpris:length"
variant uint64 437000000
@Kalyse
Kalyse / Preferences.sublime-settings
Created February 6, 2014 11:51
Sublime Settings
{
"color_scheme": "Packages/Custom/SolarSooty.tmTheme",
"font_size": 10,
"ignored_packages":
[
"Vintage"
],
"soda_folder_icons": true,
"tab_size": 4,
"theme": "Soda Dark 3.sublime-theme",
@Kalyse
Kalyse / All Amenities.txt
Created February 6, 2014 13:35
Rentivo Amenities
'Casino', 'Theme Park', 'Funicular Railway', 'Library', 'Public Villas & Gardens', 'National Park', 'National Heritage', 'Religious', 'Museum', 'Historical Monuments', 'Historical Ruins', 'Church', 'Golf', 'Bicycling', 'Bike Rentals', 'Boat Rentals/Charters', 'Canoeing/Kayaking', 'Fishing', 'Gym', 'Hiking/Trails', 'Horseback Riding', 'Float Plane/Helicopter', 'Rowing Boats', 'Sailing', 'Tennis Court', 'Table Tennis', 'Squash', 'Ice Skating', 'Local Park/Green Space', 'Skidoo/Snow Mobile', 'Water Theme Park', 'Spa Wellness Centre', 'Wind Surfing', 'Skiing - Snow', 'Snow Boarding', 'Skiing - Water', 'Ice Rink', 'Scuba Diving', 'Internet - Wi-Fi', 'Internet - Dial-up', 'Internet - Cabled', 'Internet - Dongle', 'Internet - Highspeed', 'Telephone', 'Fax Machine', 'Computer Available', 'Standard Definition TV', 'High Definition TV', 'Satellite TV', 'Digital TV', 'VCR Player', 'iPod Docking Station', 'DVD Player', 'Games Console', 'Video Game Library', 'Cable TV', 'Movie/Video Library', 'Music Library', 'Stereo Syst
@Kalyse
Kalyse / translate.sublime-snippet
Created May 12, 2014 09:20
Snippet for Sublime Translate
<snippet>
<content><![CDATA[
<?= \$this->translate("${TM_SELECTED_TEXT}"); ?>
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<!-- <tabTrigger>hello</tabTrigger> -->
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>source.python</scope> -->
</snippet>
@Kalyse
Kalyse / availability_iframe.html
Created May 20, 2014 09:28
Embed a Rentivo Availability Widget
<iframe width=800 height=1400 src="https://www.rentivo.com/it/widget/property/48298/PropertyAvailability/renderScript/propertyAvailability_Basic.phtml"></iframe>
@Kalyse
Kalyse / Sticky.js
Created May 22, 2014 14:39
Dojo Sticky Module
define( [
"dojo/_base/declare",
"dojo/_base/connect",
"dojo/_base/lang",
"dojo/_base/fx",
"dojo/fx/easing",
"dojo/dom-style",
"dojo/dom-construct",
"dojo/dom-class",
"dojo/dom",
@Kalyse
Kalyse / Geohash.js
Last active August 29, 2015 14:01
GeoHash JS
(function (factory) {
if (typeof define === 'function' && define.amd ) {
// AMD. Register as module
if(typeof dojo === 'object') {
define(["dojo/_base/declare"], function(declare){
return declare( "my.calc.GeoHash", null, factory());
});
} else {
@Kalyse
Kalyse / JsonRest.js
Created May 30, 2014 13:31
Extended JsonRest Store
define([
"dojo/_base/xhr",
"dojo/json",
"dojo/_base/declare",
"dojo/store/util/QueryResults",
"dojo/_base/Deferred",
"dojo/_base/lang" ] ,
function(xhr, JSON, declare, QueryResults, Deferred, lang) {
// module:
// dojo/store/JsonRest
<rentivo>
<widget>
<name>locationsMap</name>
<options>
<renderScript>pathToFile.phtml</renderScript>
<location>
<lat>23.203934</lat>
<lng>-45.93904</lng>
</location>
</options>
@Kalyse
Kalyse / query.md
Created July 5, 2014 15:35
Query for Updating Entities to Match their Geo Places lft values.
id woeId lft
1 3894384 XXX
2 3894385 XXX
3 3894386 XXX

woeId | name | lft -----------| ---- | ---- | --------- 3894384 | A | 23