Skip to content

Instantly share code, notes, and snippets.

@zarac
zarac / SetTagsFile.vim
Last active Sep 25, 2015
vim SetTagsFile()
View SetTagsFile.vim
"" Path to tags file.
function! SetTagsFile()
let cwd = expand('%:p:h')
if cwd =~# "/some/path/.*"
if !exists("tags[/some/path/tags]")
set tags+=/some/path/tags
endif
endif
endfunction
@zarac
zarac / autocmd-BookmarkRemove.patch
Created Aug 9, 2013
vimperator patch - BookmarkRemove event
View autocmd-BookmarkRemove.patch
diff -r 6e73b263c987 common/content/bookmarks.js
--- a/common/content/bookmarks.js Wed Jul 10 23:31:27 2013 +0900
+++ b/common/content/bookmarks.js Fri Aug 09 07:02:39 2013 +0200
@@ -187,6 +187,8 @@
let bookmarkObserver = function (key, event, arg) {
if (event == "add")
autocommands.trigger("BookmarkAdd", arg);
+ else if (event == "remove")
+ autocommands.trigger("BookmarkRemove", arg);
};
View index.html
<!DOCTYPE html>
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type"></meta>
<title>where am i?</title>
<link href="css/index.css" type="text/css" rel="stylesheet"></link>
@zarac
zarac / app.js
Created Oct 21, 2013
couchapp app.js
View app.js
var couchapp = require('couchapp')
var path = require('path')
var ddoc = {
_id : "_design/index",
rewrites : [
{ from : '',
to : '_list/tags/tag' },
{ from : '*',
@zarac
zarac / couchapp-push.sh
Last active Dec 26, 2015
.sh couchapp push
View couchapp-push.sh
#!/bin/sh
up='user:password'
line="couchapp push app.js http://${up}@host/database"
echo $line
$line
@zarac
zarac / scrapeIt.js
Created Feb 4, 2014
narpm.org-scraper
View scrapeIt.js
/*
* A scraper for narpm.org, as described at
* https://www.odesk.com/o/jobs/job/_~011b56c2f6e6ad6885/
*
* The job got cancelled and therefore this script.
*/
/* libz */
var request = require('request')
var $ = require('cheerio')
View popup.js
favit.bookmarks(null , function(data) {
console.log('data', data)
dust.render('
for (var i = 0 ; i < data.rows.length ; i++)
$('section.bookmark').append('<article class="bookmark"><a href="' + data.rows[i].value.url + '">' + data.rows[i].value.title + '</a></article>') } )
View khl-vim-func-test.vim
function! Testicle(hi)
echomsg 'XXXX'
echomsg a:hi
echomsg getline(".")
endfunction
View gist:277835df063315bf300c
/**
* Created by zarac on 10/28/14.
*/
import com.microsoft.sqlserver.jdbc.SQLServerDriver;
import java.sql.*;
public class mainz0r {
public static String connectionUrl = "jdbc:sqlserver://vart.nu:8887;databaseName=GRUPP18C;user=alle;password=hemligt;";
View ffrecord
#!/bin/sh
FILE=$1 && shift
# screen with and height
wh=$(xrandr | grep '*' | awk '{ print $1 }')
w=$(echo $wh | awk -F'x' '{ print $1 }')
h=$(echo $wh | awk -F'x' '{ print $2 }')
if [ -z $FPS ]; then