This file contains 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
var ShutdownHook = { | |
prefs: PrefsService, // wrapper around XPCOM preferences API | |
register: function() { | |
if (this.prefs.shutdownRegistered) { | |
return; | |
} | |
var observerService = |
This file contains 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
(* | |
Public Domain, 2010 | |
Chetan Sarva <[email protected]> | |
http://chetanislazy.com/ | |
See also: | |
http://blog.entourage.mvps.org/2009/02/use_growl_with_entourage.html (original, help) | |
http://blog.geekdaily.org/2007/12/growl-for-entou.html (another script, borrowed some ideas) | |
*) |
This file contains 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 LinesOfCode | |
include Extension | |
first_time do | |
# Define task not specific to any projet. | |
desc 'Count lines of code in current project' | |
Project.local_task('loc') | |
end |
This file contains 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
#!/usr/bin/ruby | |
if ARGV.empty? then | |
puts "usage: reduce_deps.rb <file with dep constants>" | |
exit | |
end | |
deps_file = ARGV[0] | |
orig_consts = Object.constants |
This file contains 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
function clearCharSetAndCollation() | |
local schemata = grtV.getGlobal("/wb/doc/physicalModels/0/catalog/schemata") | |
local s | |
local tables | |
local t | |
for s=1, grtV.getn(schemata) do | |
print(schemata[s].name .. "\n") |
This file contains 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
#!/usr/bin/ruby | |
# | |
# adduser - Unix-like adduser script. Prompts for parameters and uses dscl internally to create | |
# new NetInfo users and groups. | |
# | |
# Chetan Sarva <[email protected]> | |
def next_user_id(start = 700) | |
ids = `dscl . -list /Users UniqueID`.split("\n").map{|s| s =~ /(\d+)$/; $1 }.sort.uniq | |
n = start |
This file contains 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
# Buildr project bootstrapper | |
# Chetan Sarva <[email protected]> | |
# | |
# Creates standard java project layout directories and files such as etc, src | |
# and README. | |
# | |
# USAGE | |
# | |
# buildr bootstrap | |
# |
This file contains 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
javascript:%20var%20x=%20$(".content").find("a").not(".thumbnail").each(function(){var%20href=$(this).attr("href");if((!$(this).hasClass("drowsapMorphed"))%20&&%20($(this).next(".drowsapMorphed").length==0)%20&&%20href%20&&%20(href.indexOf('imgur')>=0%20||%20href.indexOf('jpeg')>=0%20||%20href.indexOf('jpg')>=0%20%20||%20href.indexOf('png')>=0)){var%20ext%20=(href.indexOf('imgur')>=0%20&&%20href.indexOf('jpg')<0%20&&%20href.indexOf('png')<0)%20?%20'.jpg'%20:'';%20var%20img%20=%20$("<a%20class='drowsapMorphed'%20href='"+href+"'%20target='blank'%20style='display:block'><img%20style='display:block;max-width:780px;'%20src='"+href+%20ext+"'%20/></a>");$(this).after(img);}}); |
This file contains 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
#!/bin/sh | |
# script for batch running sysbench I/O tests for mysql workload | |
# http://www.mysqlperformanceblog.com/2009/08/06/ec2ebs-single-and-raid-volumes-io-bencmark/ | |
set -u | |
set -x | |
set -e | |
for size in 256M 16G; do |
This file contains 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
#!/usr/bin/env ruby | |
module SysBench | |
class IO | |
attr_accessor :version, :threads, :test | |
attr_accessor :total_size, :block_size | |
attr_accessor :byte_rate, :request_rate | |
attr_accessor :min, :max, :avg, :top | |
OlderNewer