Skip to content

Instantly share code, notes, and snippets.

@naquad
naquad / vimrc
Created February 26, 2014 22:42
function! s:Extract(remove) range
if a:remove == '!'
let cmd = 'd'
else
let cmd = 'y'
endif
exe ':' . a:firstline . ',' . a:lastline . cmd
new
function _service_services {
systemctl list-unit-files --no-legend --no-pager --full | \
awk '/\.service/&&!/@|systemd/{
gsub(".service", "");
print $1;
}'
}
function _service_completion {
if (( CURRENT == 3 ))
CREATE TABLE `posts` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`network` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`net_id` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`message` text COLLATE utf8_unicode_ci,
`link` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`thumbnail` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`visible` tinyint(1) DEFAULT '1',
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
class YouTube
attr_accessor :uid, :cnt
def initialize(uid, cnt = 50)
@uid = uid
@cnt = cnt
end
def user_url
"http://gdata.youtube.com/feeds/api/users/#{CGI.escape(@uid)}/uploads?max-results=#{CGI.escape(@cnt.to_s)}"
let s:line_cont = '\\\s*$'
"
" lines are something like:
" [
" "/* #!ruby \\",
" " * -w"
" " *",
" " * puts 'Hello, world'"
" "*/"
#include <stdio.h>
// the main purpose of the plugin is
// to take a range of lines, strip out comments,
// execute given command with given stdin input
// and put its output after selected area.
// For example:
/*
* ruby
// ------- Preamble -------- //
#include <avr/io.h>
#include <util/delay.h>
struct {
int delay;
uint8_t len;
uint8_t *pattern;
} patterns[] = {
{
//= require uikit
//= require_self
@import "../fonts/stylesheet.css";
html, body {
margin: 0;
padding: 0;
min-height: 100%;
}
$ ->
init_map = (self) ->
[lat, lng, zoom] = [self.attr('data-lat'), self.attr('data-lng'), self.attr('data-zoom')]
pos = new google.maps.LatLng(lat, lng)
map = new google.maps.Map self[0],
center: pos
zoom: parseInt(zoom) or 7
mapTypeId: google.maps.MapTypeId.ROADMAP
import json
import os
import sys
class BookLoadingError(RuntimeError):
pass
class Book:
LOADERS = ['load_doka', 'load_devdocs', 'load_devhelp']