Skip to content

Instantly share code, notes, and snippets.

@biswanaths
biswanaths / doom.txt
Created May 16, 2022 11:43 — forked from hjertnes/doom.txt
Doom Emacs Cheatsheet
SPC
SPC: find file
, switch buffer
. browse files
: MX
; EX
< switch buffer
` eval
u universal arg
x pop up scratch
CREATE FUNCTION appendbar(s1 varchar) RETURNS varchar IMMUTABLE AS $$
def appendbar(value):
value = value or ""
return value + "_bar"
return appendbar(s1)
$$ language plpythonu;
const localdb = require('node-persist')
const when = require('when');
class QueuedStorage {
constructor() {
this.storage = localdb.create({ ttl: true, logging: false})
}
@biswanaths
biswanaths / migrate.py
Created July 20, 2015 20:37
Issue migration from JIRA to github
#!/usr/bin/python
import urllib, urllib2, json
from bs4 import BeautifulSoup
import base64
token="<github access token>"
base_jira = "https://issues.scala-lang.org/browse/SI-"
base_jira_api = "https://issues.scala-lang.org/rest/api/2/issue/SI-%s/comment"
jQuery(function($) {
// returns an array of the potential selector components for the first element in the jQuery object. IDs, classes, and tagNames only.
var getSelectorComponents = function($el) {
var components = [];
var id = $el.attr('id');
if (typeof(id)!='undefined' && /[^\s]/.test(id)) {
components.push('#'+id);
}
def __init__(self, *args, **kwargs):
super(CpasbienSpider, self).__init__(**kwargs)
self.keywords = kwargs['keywords'].split(',')
print self.keywords
self.start_urls = [
'http://cpasbien.pe/recherche']
reviews = LOAD '/tmp/reviews.avro' USING AvroStorage();
reviews = LIMIT reviews 1000;
bar = FOREACH reviews GENERATE business_id, FLATTEN(varaha.text.SentenceTokenize(text)) AS sentences;
DUMP bar
@biswanaths
biswanaths / Autofac and dispose
Created January 12, 2012 17:27
Container dispose, disposes the components it has provided
using System;
using System.Globalization;
using Autofac;
namespace ConsoleApplication1
{
class Program
{
class Good:IDisposable
{