Skip to content

Instantly share code, notes, and snippets.

View handlename's full-sized avatar

NAGATA Hiroaki handlename

View GitHub Profile
@handlename
handlename / string-width-in-regien.el
Created April 15, 2011 07:35
display string width in current buffer to mini buffer.
(defun string-width-in-region (start end)
(interactive "r")
(princ (string-width (buffer-substring start end))))
var array = [
1,
2,
[10, 11, 12],
[20, 21, [30, 31]],
3
];
console.log('before');
console.log(array);
var http = require("http");
http.get({
host: "example.com",
port: 80,
path: "/"
}, function(res) {
var text = "";
res.setEncoding("utf8");
module.exports = function(callbacks, args) {
if (0 < callbacks.length) {
callbacks.shift()(callbacks, args);
}
};
var next = require("path/to/next");
function first(callbacks, params) {
asyncProcess(function(res) {
params.first = res;
next(callbacks, params);
});
}
function second(callbacks, params) {
@handlename
handlename / linkedin_withdraw.pl
Created January 9, 2012 11:47
withdraw all requsts on LinkedIn.
#!/usr/bin/env perl
use strict;
use warnings;
use WWW::Mechanize;
my $email = shift;
my $password = shift;
@handlename
handlename / gist:1851372
Created February 17, 2012 06:45
Style file for Twitter
@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document
url-prefix("https://twitter.com") {
div.dashboard {
display: none;
}
div.content-main {
width: 650px !important;
@handlename
handlename / gist:1928772
Created February 28, 2012 02:31
search char sequentially
;; search char
;; http://dev.ariel-networks.com/wp/documents/aritcles/emacs/part16
;; List3
(defvar last-search-char nil)
(defvar last-search-direction 'forward)
(defun search-forward-with-char (char)
(interactive "cMove to Char: ")
(if (eq (char-after (point)) char) (forward-char))
(and (search-forward (char-to-string char) nil t)
@handlename
handlename / canything.rb
Created March 26, 2012 02:23
Homebrew Formula for canything.
require 'formula'
class Canything < Formula
url 'https://github.com/keiji0/canything/zipball/master'
sha1 '85d243ee8f98b393e165ce16def61640949431dd'
homepage 'https://github.com/keiji0/canything'
version '20110511'
def patches;
DATA;