Skip to content

Instantly share code, notes, and snippets.

View Sakurina's full-sized avatar

Yanik Magnan Sakurina

View GitHub Profile
@Sakurina
Sakurina / README.markdown
Created March 13, 2012 21:15
seaside - quickly start torrents in transmission from your iOS devices

seaside

seaside is a script that lets you quickly start torrents on Transmission on your home computer from an iOS device. How quickly? As quickly as copying the URL to the torrent file or a magnet link to the clipboard.

Requirements

  • Transmission with the Web server enabled
  • MyScripts on your iOS device
  • You must be on the same LAN as your computer or have port forwarding and whatnot configured. Currently, this does not work with password-protected servers.
@Sakurina
Sakurina / open-in-4sq.bookmarklet.js
Created March 9, 2012 06:08
open a foursquare venue from a browser in the iOS app (original src + Closure Compiled bookmarklet)
javascript:(function(){var a=document.location.pathname.split("/"),b=a.length-1;if(!(0>=b)&&"v"==a["touch"==a[1]?2:1])document.location="foursquare://venue/"+a[b];})()
@Sakurina
Sakurina / README.markdown
Created January 31, 2012 23:47
hotaru - automagically replaces images with retina display variants

hotaru

Just add a retina-src attribute to img tags pointing to a Retina Display version of your image, load this script, and Retina Display resources will automatically get subbed in when appropriate.

License

Copyright (c) 2012 Yanik Magnan ([email protected])

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above

@Sakurina
Sakurina / t3_bruteforce.rb
Created October 30, 2011 16:39
a horrific attempt at brute forcing technika 3 album art URLs, could probably be greatly improved, uses repeated_permutation which requires ruby 1.9.x
require 'uri'
require 'net/http'
def url_for_songname(songname)
"http://img3.platinumcrew.co.kr/icon/disc/110/#{songname}_1.png"
end
def all_possibilities_for_this_many_characters(c)
char_seq = []
(97..122).each do |charcode| # letters
@Sakurina
Sakurina / slaveplay.m
Created June 18, 2011 15:56
an example for @r_plus
-(void) setMasterToggle:(id)value specifier:(id)specifier {
// You'd set the "set" property for your switch in your plist to
// "setMasterToggle:specifier:" so this gets called
[self setPreferenceValue:value specifier:specifier];
BOOL boolValue = [value boolValue];
// "SlaveToggle" is the ID of the toggle that depends on this switch
PSSpecifier* slaveSpecifier = [self specifierForID:@"SlaveToggle"];
overlaps = From et In DataSetManager.employeTache.Rows Where _
(et IsNot ModifiableRow AndAlso modifyingDatabaseTask = False) And _
et.item("noEmploye") = noEmploye And _
((startTime >= et.item("dateDebutEmployeTache") And startTime <= et.item("dateFinEmployeTache")) OrElse _
(endTime >= et.item("dateDebutEmployeTache") And endTime <= et.item("dateFinEmployeTache")) OrElse _
(et.item("dateDebutEmployeTache") >= startTime AndAlso et.item("dateFinEmployeTache") <= endTime)) _
Select et
If (overlaps.Count > 0) Then
Return True
End If
function runScriptsYo(doc) {
var scripts = doc.getElementsByTagName("script");
for (var i=0; i<scripts.length; i++)
eval(scripts[i].firstChild.nodeValue);
}
@Sakurina
Sakurina / oo-plsql.sql
Created March 30, 2011 20:05
object-oriented PL/SQL for situations where PL/SQL's own object system isn't accessible (Forms)
set serveroutput on
-- create a table to test against
CREATE TABLE objects(
id NUMBER,
text VARCHAR2(255)
);
INSERT INTO objects VALUES(1, 'a');
INSERT INTO objects VALUES(2, 'b');
@Sakurina
Sakurina / ICQuery.cy
Created December 28, 2010 04:59
ICQuery - helpers for working with icon lists from cycript
/*
* ICQuery - helpers for working with icon lists from cycript
* by Yanik Magnan - http://r-ch.net
*
* EXAMPLES:
* i$(0) => dictionary containing the 0th icon list model and view
* i$(ilModel) => index of that icon list model in the root folder
* i$(ilView) => index of that icon list view in the root folder
*
* WHAT ABOUT NON-ROOT FOLDERS?
@Sakurina
Sakurina / HappyHolidaysYouBastard.vb
Created December 8, 2010 20:44
handing in a project early next week? want to leave the correctors a holiday surprise? call HappyHolidays.YouBastard() on app launch, and if the date is >= 2010-12-15, they will be redirected to a YouTube video of Blink-182's Happy Holidays, You Bastard.
Imports System.Diagnostics
Public Class HappyHolidays
Private Shared a As Integer = 0
Private Shared b As Integer = 1
Private Shared c As DateTime
Private Shared d As String = ""
Private Shared e As Integer() = {0, 0, 0, 0, 0, 0, 0, 0}
Private Shared f As Integer() = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}