This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Quick and dirty script to extract Quartus II .qar archives | |
import os, sys, struct, zlib | |
buf = open(sys.argv[1], 'rb').read() | |
file_no = struct.unpack_from('<H', buf, 2)[0] | |
off = 4 | |
for _ in range(file_no): | |
(len, unk, filename_len) = struct.unpack_from('<IHH', buf, off) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func! Format(_, what) abort | |
let flags = ' +'[a:what.changed] | |
\ . ' %'[a:what.bufnr == bufnr('')] | |
\ . ' #'[a:what.bufnr == bufnr('#')] | |
if empty(a:what.name) | |
let name = '[No Name]' | |
else | |
let name = fnamemodify(a:what.name, ':~:.') | |
endif | |
return printf(" %2d %s %s", a:what.bufnr, flags, name) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func! Format(this, alt, _, what) abort | |
let flags = ' +'[a:what.changed] | |
\ . ' %'[a:what.bufnr == a:this] | |
\ . ' #'[a:what.bufnr == a:alt] | |
let name = empty(a:what.name) ? | |
\ '[No Name]' : fnamemodify(a:what.name, ':~:.') | |
return printf(" %2d %s %s", a:what.bufnr, flags, name) | |
endfunc | |
func! Sort(a, b) abort | |
return a:a.bufnr < a:b.bufnr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/ex_cmds2.c b/src/ex_cmds2.c | |
index 2b07352..d723251 100644 | |
--- a/src/ex_cmds2.c | |
+++ b/src/ex_cmds2.c | |
@@ -4237,27 +4237,6 @@ do_source( | |
save_sourcing_lnum = sourcing_lnum; | |
sourcing_lnum = 0; | |
-#ifdef FEAT_MBYTE | |
- cookie.conv.vc_type = CONV_NONE; /* no conversion */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local utils = require("mp.utils") | |
function enableDpms(v) | |
if v then | |
arg = '+dpms' | |
else | |
arg = '-dpms' | |
end | |
utils.subprocess({ args = { 'xset', arg } }) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// gcc grab.c -lxcb -lxcb-xfixes -lxcb-xinput -Wall -o grab | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <signal.h> | |
#include <errno.h> | |
#include <sys/select.h> | |
#include <sys/time.h> | |
#include <xcb/xcb.h> | |
#include <xcb/xinput.h> | |
#include <xcb/xfixes.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let s:has_git = executable('git') | |
fun! s:find_root() | |
let cvs_dir = ['.git', '.hg', '.svn', '.bzr', '_darcs'] | |
let dir = getcwd() | |
let depth = 10 | |
if !exists('g:root_cache') | |
let g:root_cache = [] | |
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let g:airline#themes#apprentice#palette = {} | |
let s:N1 = [ '#bcbcbc', '#5f5f87', 250, 60 ] | |
let s:N2 = [ '#1c1c1c', '#ff8700', 234, 65 ] | |
let s:N3 = [ '#262626', '#87875f', 235, 101 ] | |
let g:airline#themes#apprentice#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3) | |
let g:airline#themes#apprentice#palette.normal.airline_warning = [ '#1c1c1c', '#ffffaf', 234, 1 ] | |
let s:I1 = [ '#1c1c1c', '#87af87', 234, 108 ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Extract/import database entries from G6_GRAPH.BIN database | |
# The Lemon Man (C) 2014 | |
use strict; | |
use warnings; | |
use File::Slurp; | |
use JSON qw(from_json to_json); | |
sub json_to_db ($) { | |
my $text = read_file shift; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <sys/io.h> | |
int convert_bcd (unsigned char bcd) { | |
return (bcd >> 4) * 10 + (bcd & 0xF); | |
} | |
unsigned char cmos_read (int offset) { | |
outb(0x80 | (offset & 0x7F), 0x70); | |
return inb(0x71); |
NewerOlder