Skip to content

Instantly share code, notes, and snippets.

// ==UserScript==
// @name Opera Style Link Drag
// @author Griever satyr
// @include main
// @include chrome://global/content/viewSource.xul
// @include chrome://global/content/viewPartialSource.xul
// @version 0.0.1.20100421
// ==/UserScript==
Array.forEach(document.querySelectorAll('tabbrowser, browser'), function(b){
b.addEventListener('mousedown', this, true);
@satyr
satyr / 666.js
Created May 2, 2010 07:00 — forked from asafd1/666
CmdUtils.CreateCommand({
names: ["666"],
domain: "seret.co.il",
arguments: [
{role: "object", label: 'what', nountype: noun_arb_text}
],
description: "seret.co.il חפש סרט באתר",
icon: "http://www.seret.co.il/favicon.ico",
homepage: "http://sites.google.com/site/ubiquityisrael",
author: { name: "Asaf David", email: "[email protected]"},
@satyr
satyr / replace.ubiquity.js
Last active May 11, 2016 23:58
[forked] replace.ubiquity.js
var noun_typed_text = {
name: 'typed text',
suggest: function suggestTyped(txt, htm, cb, si){
return !si && {text: txt, summary: htm, score: .4}
},
}
var replace = CmdUtils.CreateCommand({
name: 'replace',
icon: 'chrome://ubiquity/skin/icons/page_refresh.png',
(function(){
// ある関数について、最初に呼び出されたときと2回目以降で処理を分ける方法
// 自分自身を書き換える関数
// 初期化コストが低いが、見た目がイマイチ
// 関数宣言でなくても良いが、関数宣言なら定義する場所を気にしなくて良くなる
function A(){
A = _A;
/*一回目の処理*/
// _A.apply(this,arguments);//2回目の処理を呼ぶこともOK
@satyr
satyr / twitter-oauth-caution.user.css
Created June 2, 2010 04:29 — forked from mooz/twitter-oauth-caution.user.js
Twitter OAuth Caution (CSS only)
@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document
url-prefix(https://twitter.com/oauth/authenticate?),
url-prefix(https://twitter.com/oauth/authorize?),
url-prefix(https://api.twitter.com/oauth/authenticate?),
url-prefix(https://api.twitter.com/oauth/authorize?),
url-prefix(http://twitter.com/oauth/authenticate?),
url-prefix(http://twitter.com/oauth/authorize?),
url-prefix(http://api.twitter.com/oauth/authenticate?),
url-prefix(http://api.twitter.com/oauth/authorize?) {
function StickamLargeChat_old (id) {
var start = "<object width='820' height='490' codebase='http:\/\/fpdownload.macromedia.com\/pub\/shockwave\/cabs\/flash\/swflash.cab#version=8,0,0,0' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'>\n" +
"<embed src='http:\/\/player.stickam.com\/flash\/stickam\/stickam_player.swf?app=stickam_chat_open.swf&userID=";
var end="' width='820' height='490' type='application/x-shockwave-flash' quality='high' allowscriptaccess='always' allowfullscreen='true' flashvars='webID=84634C6CDD408CA62D5DBD086DF5E196&webSeq=&userType=205&skinName=open&app=stickam_chat_open.swf&userIP=127.0.0.1&skinType=open&sessionType=115&userSiteID=1015547&autoplay=1&playerID=7334381&langID=en&'>\n" +
"<\/embed><\/object>";
return (start+id+end);
}
function StickamLargeChat(id){
var start = "<object width='320' height='240' codebase='http:\/\/fpdownload.macromedia.com\/pub\/shockwave\/cabs\/flash\/swflash.cab#version=8,0,0,0' classid='clsid:D27CDB6E-AE6D-11cf-96B8-4445535
@satyr
satyr / update.coffee
Created December 30, 2010 00:44 — forked from cj/update.coffee
name= if previous_keys.length > 0
then "#{main_key}[#{_.implode('][', previous_keys)}][#{key}]"
else "#{main_key}[#{key}]"

"In our study of program design, we have seen that expert programmers control the complexity of their designs with the same general techniques used by designers of all complex systems. They combine primitive elements to form compound objects, they abstract compound objects to form higher-level building blocks, and they preserve modularity by adopting appropriate large-scale views of system structure. In illustrating these techniques, we have used Lisp as a language for describing processes and for constructing computational data objects and processes to model complex phenomena in the real world.

However, as we confront increasingly complex problems, we will find that Lisp, or indeed any fixed programming language, is not sufficient for our needs. *We must constantly turn

@satyr
satyr / sudoku.co
Created April 20, 2011 17:26 — forked from jonelf/gist:927782
# Sudoku solver in Coco based on the Python solution by Peter Norvig
# http://norvig.com/sudoku.html
# 2011-04-19 [email protected]
# 2011-04-21 satyr
#
# Throughout this program we have:
# r is a row, e.g. 'A'
# c is a column, e.g. '3'
# s is a square, e.g. 'A3'
# d is a digit, e.g. '9'
@satyr
satyr / state-monad.co
Created April 22, 2011 13:09 — forked from igstan/state-monad.coffee
State Monad in Co{co,ffeeScript}
push = (value) -> (stack) -> {value, stack: [value]concat stack}
pop = (stack) -> value: stack.0, stack: stack.slice 1
bind = (stackOperation, continuation) -> (stack) ->
result = stackOperation stack
continuation(result.value) result.stack
result = (value) -> (stack) -> {value, stack}