This file contains hidden or 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 | |
# | |
# Ruby/GNTP example : twitter notifier | |
# | |
# Usage: {{{ | |
# Please type the following command from command line, | |
# and then, this script gets your time-line every 30 seconds. | |
# | |
# > ruby twitter_notifyer.rb | |
# |
This file contains hidden or 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 | |
# Growl notifier command | |
# Usage: | |
# gntp-notify [message] | |
# License: | |
# public domain | |
require "rubygems" | |
require "ruby_gntp" # >= ver.0.1.0 |
This file contains hidden or 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
#include <stdio.h> | |
#include <sys/types.h> | |
#include <sys/socket.h> | |
#include <netinet/in.h> | |
int | |
main() | |
{ | |
int sock0; | |
struct sockaddr_in addr; |
This file contains hidden or 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
// | |
// socket client sample | |
// | |
socket = (function(){ | |
logCrear(); | |
log("start"); | |
var socketService = Components.classes["@mozilla.org/network/socket-transport-service;1"] | |
.getService(Components.interfaces.nsISocketTransportService); |
This file contains hidden or 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
#include <stdio.h> | |
#include <winsock2.h> | |
void sendAndRecieve(char *message) { | |
struct sockaddr_in server; | |
SOCKET sock; | |
char buf[2048]; | |
// Create socket | |
sock = socket(AF_INET, SOCK_STREAM, 0); |
This file contains hidden or 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
#include <stdio.h> | |
#include <windows.h> | |
BOOL convSJIStoUTF8( BYTE* pSource, BYTE* pDist, int* pSize ) | |
{ | |
*pSize = 0; | |
// Convert SJIS -> UTF-16 | |
const int nSize = ::MultiByteToWideChar( CP_ACP, 0, (LPCSTR)pSource, -1, NULL, 0 ); |
This file contains hidden or 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
liberator.plugins.sqliteReorg = (function(){ | |
const ss = Cc["@mozilla.org/storage/service;1"].getService(Ci.mozIStorageService); | |
function getSQLiteFiles(){ | |
let profDir = services.get("directory").get("ProfD", Ci.nsIFile); | |
let files = profDir.directoryEntries; | |
let reg = new RegExp("\\.sqlite$"); | |
while (files.hasMoreElements()){ | |
let file = files.getNext().QueryInterface(Ci.nsIFile); | |
if (file.isFile() && reg.test(file.leafName)){ | |
yield file; |
This file contains hidden or 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
# | |
# biff.rb | |
# Simple biff(Mail check and notify tool) | |
# | |
# This script is example of Ruby/GNTP library | |
# (http://snaka.github.com/ruby_gntp/) | |
# | |
# Setup: | |
# you need follown gems. | |
# - ruby_gntp |
This file contains hidden or 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
<html> | |
<head> | |
<title>Canvas tutorial</title> | |
<script type="text/javascript"> | |
var ctx = null; | |
function draw(){ | |
var canvas = document.getElementById('tutorial'); | |
if (canvas.getContext){ | |
ctx = canvas.getContext('2d'); |
This file contains hidden or 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
// Cheat sheet generator command for Vimperator | |
plugins.cheat_sheet = (function () { | |
commands.addUserCommand( | |
["cheat"], | |
"Show cheat sheet", | |
function(args) { | |
showCheatSheet(); | |
}, | |
null, |