Skip to content

Instantly share code, notes, and snippets.

@sekimura
sekimura / gist:6367366
Last active December 10, 2021 16:56
phabricator workflow
  • create tasks T{NNNN} asign them
  • create a branch with name like "T{NNNN}-boo-hoo"
  • git checkout -b T1234-boo-foo
  • commit changes on that branch until it gets ready to be reviewed
  • git commit -am 'first'
  • git commit -am 'now it works'
  • check if it's lint free (NOTE: it runs lint against only modified files)
  • arc lint
  • push a review request to the server. This will create a diff with id D{NNNN}
  • arc diff
@sekimura
sekimura / watercoolr.pl
Created August 3, 2009 06:21
watercoolr (pubsub via webhooks) in Perl
#!/usr/bin/perl
## Perl implementation of watercoolr : http://watercoolr.nuklei.com/
use strict;
use warnings;
use AnyEvent::HTTPD;
use AnyEvent::HTTP;
use Coro::AnyEvent;
@sekimura
sekimura / text_strip_margin.py
Created May 13, 2012 04:08
Text (heredoc) strip margin in Python
import re
def strip_margin(text):
return re.sub('\n[ \t]*\|', '\n', text)
def strip_heredoc(text):
indent = len(min(re.findall('\n[ \t]*(?=\S)', text) or ['']))
pattern = r'\n[ \t]{%d}' % (indent - 1)
return re.sub(pattern, '\n', text)
@sekimura
sekimura / simple chat server by using AnyEvent
Created July 22, 2009 07:50
simple chat server by using AnyEvent
#!/usr/bin/perl
use strict;
use warnings;
use AnyEvent;
use AnyEvent::Socket qw/tcp_server/;
use AnyEvent::Handle;
my %conns;
Domain ID:D98203603-LROR
Domain Name:QOOTAS.ORG
Created On:27-May-2003 21:47:18 UTC
Last Updated On:01-Dec-2009 21:52:03 UTC
Expiration Date:27-May-2013 21:47:18 UTC
Sponsoring Registrar:Wild West Domains, LLC (R120-LROR)
Status:CLIENT DELETE PROHIBITED
Status:CLIENT RENEW PROHIBITED
Status:CLIENT TRANSFER PROHIBITED
Status:CLIENT UPDATE PROHIBITED
import sys
import urllib2
import xml.etree.ElementTree as ET
PING_URL = 'http://www.google.com/webmasters/tools/ping?sitemap=%s'
def fetch_sitemaps(sitemapindex):
response = urllib2.urlopen(sitemapindex)
xml = response.read()
@sekimura
sekimura / modifykeys.sh
Created January 31, 2013 20:26
swapping Ctrl-Caps keys from terminal
#!/bin/bash
key="com.apple.keyboard.modifiermapping"
defaults -currentHost delete -g $key
defaults -currentHost write -g $key '(
{
HIDKeyboardModifierMappingDst = 2;
HIDKeyboardModifierMappingSrc = 0;
},
{
def partition(data, lo, hi):
pivot = data[lo]
print 'part', lo, hi, pivot
i, j = lo + 1, hi - 1
while True:
while data[i] <= pivot:
i = i + 1
if i == hi:
break
while data[j] > pivot:
@sekimura
sekimura / deletePosts.js
Last active November 22, 2015 23:37
delete posts on Facebook profile page
/* After deactivating some Apps (eg Twitter, Yahoo Flickr etc), I noticed that I could not remove posts via GraphAPI
* because it would be a defferent app from the app originaly posted statuses.
* There might be a better to do it via offical APIs, but I was lazy and inspected some html class names to click
* around on my profile page and delete posts.
*
* Usage:
* 1. Go to your profile page and open Web Inspector Console (I used Google Chrome)
* 2. Copy and paste the script below to the console
* 3. Ovserve how it's deleting your posts or just open another tag to go somewhere else
*
@sekimura
sekimura / things-to-do-after-installing-64-bit-ubuntu-update.md
Created November 19, 2012 02:33
Things to do after installing 64-bit Ubuntu