Skip to content

Instantly share code, notes, and snippets.

View mk0x9's full-sized avatar

Mikhail Kuryshev mk0x9

  • Berlin, Germany
  • 05:16 (UTC +02:00)
View GitHub Profile
<!doctype html>
<html>
<head>
<title></title>
</head>
<body>
<script>
(function () {
if(/mobile/i.test(navigator.userAgent)) {
document.body.className += ' mobile';
@mk0x9
mk0x9 / mozc-1.13.1651.102.ebuild
Created June 8, 2014 21:30
mozc 1.13 w/ fcitx support
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-i18n/mozc/mozc-1.6.1187.102.ebuild,v 1.1 2012/10/02 02:47:18 naota Exp $
EAPI="5"
PYTHON_COMPAT=( python{2_6,2_7} )
inherit elisp-common eutils multilib multiprocessing python-single-r1 toolchain-funcs
DESCRIPTION="The Mozc engine for IBus Framework"
HOMEPAGE="http://code.google.com/p/mozc/"
@mk0x9
mk0x9 / getmail-wrapped
Created December 19, 2014 02:04
getmail with lockfile
#!/usr/bin/env bash
me=`basename $0`
lockfile="/tmp/$me.lock"
lock () {
if [ "$1" = "lock" ]
then
if [ -e "$lockfile" ]
then
We couldn’t find that file to show.
@mk0x9
mk0x9 / gist:752705
Created December 23, 2010 07:36
sdl.go
package sdl
func c_SDL_Init(flags uint32) int __asm__ ("SDL_Init");
func c_SDL_SetVideoMode(width, height, bpp int, flags uint32) *Surface __asm__("SDL_SetVideoMode");
func c_SDL_Delay(ms uint32) __asm__ ("SDL_Delay");
func c_SDL_Quit() __asm__ ("SDL_Quit");
func c_SDL_UpperBlit(src *Surface, srcrect *Rect, dst *Surface, dstrect *Rect) int __asm__ ("SDL_UpperBlit");
func c_SDL_Flip(screen *Surface) int __asm__ ("SDL_Flip");
func c_SDL_FreeSurface(surface *Surface) __asm__ ("SDL_FreeSurface");
func c_SDL_LoadBMP_RW(src *RWops, freesrc int) *Surface __asm__ ("SDL_LoadBMP_RW");
@mk0x9
mk0x9 / sdl_constants.c
Created December 23, 2010 17:16
sdl.go
package sdl
// #include "SDL/SDL.h"
// #include "SDL/SDL_image.h"
import "C"
import (
"unsafe"
)
package main
import (
"fmt"
)
type foo struct {
b int
c int
}
cirno@perfect-math-class ~/sources/gollvm $ make
CGOPKGPATH= cgo -- `llvm-config --cflags` core.go executionengine.go target.go transforms_scalar.go transforms_ipo.go analysis.go bitwriter.go
error: 'LLVMInitializeCppBackendTargetInfo' undeclared (first use in this function)
error: (Each undeclared identifier is reported only once
error: 'LLVMInitializeARMTargetInfo' undeclared (first use in this function)
error: 'LLVMInitializeCellSPUTarget' undeclared (first use in this function)
error: 'LLVMInitializePowerPCTargetInfo' undeclared (first use in this function)
error: 'LLVMInitializeCBackendTargetInfo' undeclared (first use in this function)
error: 'LLVMInitializeAlphaTargetInfo' undeclared (first use in this function)
error: 'LLVMInitializeMBlazeTargetInfo' undeclared (first use in this function)
package main
import "fmt"
func main() {
var x byte
for {
fmt.Scan("%c", &x)
fmt.Printf("\nGot: '%c'\n", x)
}
(defun ac-go-candidates ()
(ac-go-autocomplete))
(defvar ac-source-go
'((candidates . ac-go-candidates)
(prefix . "\\.\\(.*\\)")
(requires . 0)))
(defun ac-go-get-candidate-strings (tmpbuf)
(split-string (with-current-buffer tmpbuf (buffer-string)) "\n"))