Skip to content

Instantly share code, notes, and snippets.

View zchee's full-sized avatar
😩
want to Go knowledge...

Koichi Shiraishi zchee

😩
want to Go knowledge...
View GitHub Profile
@zchee
zchee / example.md
Created July 17, 2016 12:23 — forked from ericclemmons/example.md
HTML5 <details> in GitHub

Using <details> in GitHub

Suppose you're opening an issue and there's a lot noisey logs that may be useful.

Rather than wrecking readability, wrap it in a <details> tag!

<details>
 <summary>Summary Goes Here</summary>
@zchee
zchee / Launch_Alpine_Linux_3.3.x_on_AWS.md
Created June 25, 2016 22:10 — forked from kennwhite/Launch_Alpine_Linux_3.3.x_on_AWS.md
Launch Alpine Linux 3.3.x on Amazon Web Services

Launch_Alpine_Linux_3.3.x_on_AWS.md

Create a local VM of Alpine Linux, eg: https://gist.github.com/kennwhite/959d47a77070d365ad60

  • On your workstation open a terminal and create a new ssh keypair:

    ssh-keygen -t rsa -b 4096 -C "alpine@example.com"

    • Set a meaningful keypair base file name when prompted, eg: alpine-test
# Thanks to this post:
# http://blog.ikato.com/post/15675823000/how-to-install-consolas-font-on-mac-os-x
$ brew install cabextract
$ cd ~/Downloads
$ mkdir consolas
$ cd consolas
$ curl -O http://download.microsoft.com/download/f/5/a/f5a3df76-d856-4a61-a6bd-722f52a5be26/PowerPointViewer.exe
$ cabextract PowerPointViewer.exe
$ cabextract ppviewer.cab
@zchee
zchee / interp.go
Created June 11, 2016 06:01 — forked from elliott5/interp.go
Go Interpreter (in 35 lines) - CURRENTLY NOT WORKING
// NOT WORKING AS AT 14-JAN-14 DUE TO API CHANGES
//
// written for the Go London User Group meeting of 21st November 2013 by Elliott Stoneham
// uses code.google.com/p/go.tools/ssa/interp which warns “It is not, and will never be, a production-quality Go interpreter.”
// main() code adapted from the example given in code.google.com/p/go.tools/ssa
// requires go version 1.2
//
package main
import (
diff -r 8c8cdda36022 src/popupmnu.c
--- a/src/popupmnu.c Wed Aug 14 14:18:41 2013 +0200
+++ b/src/popupmnu.c Thu Aug 15 22:06:10 2013 +0900
@@ -639,7 +639,7 @@
{
/* Return cursor to where we were */
validate_cursor();
- redraw_later(SOME_VALID);
+ redraw_win_later(curwin, REDRAW_TOP);
diff --git a/src/edit.c b/src/edit.c
index abe26fb..b1536fc 100644
--- a/src/edit.c
+++ b/src/edit.c
@@ -2826,7 +2826,6 @@ ins_compl_upd_pum(void)
if (compl_match_array != NULL)
{
h = curwin->w_cline_height;
- update_screen(0);
if (h != curwin->w_cline_height)
@zchee
zchee / endian.h
Created June 7, 2016 03:52 — forked from yinyin/endian.h
BSD/Linux-like <endian.h> for MacOS X
#ifndef __FINK_ENDIANDEV_PKG_ENDIAN_H__
#define __FINK_ENDIANDEV_PKG_ENDIAN_H__ 1
/** compatibility header for endian.h
* This is a simple compatibility shim to convert
* BSD/Linux endian macros to the Mac OS X equivalents.
* It is public domain.
* */
#ifndef __APPLE__
@zchee
zchee / CCacheMacNinja.md
Created March 14, 2016 00:50 — forked from jjgod/CCacheMacNinja.md
Using ccache for Mac builds

Introduction

ccache is a compiler cache. It speeds up recompilation of C/C++ code by caching previous compilations and detecting when the same compilation is being done again. This often results in a significant speedup in common compilations, especially when switching between branches. This page is about using ccache on Mac with clang and ninja build system. If you want to use Xcode, please refer to the old CCacheMac page.

In order to use ccache with clang, you need to use the current git HEAD, since the most recent version (3.1.9) doesn't contain the patch needed for using chromium style plugin.

Installation

To install ccache with [homebrew](http://mxcl.

@zchee
zchee / README.md
Created March 13, 2016 18:02 — forked from balupton/README.md
Installing ChromiumOS

Install ChromiumOS

  1. Get Chromium OS from one of the following places
    1. Download the vanilla build (old but stable): http://chromeos.hexxeh.net/
      1. NOTE: Password is facepunch
    2. Download the nightly build (sync doesn't work): http://download-chromiumos.appspot.com/
      1. NOTE: If you want developer mode, you must change _base_ in the download URL to _test_ as the base image does not have developer tools enabled
      2. NOTE: Password is unknown, instructions for working around this are provided later
      3. NOTE: I could not get syncing working with this build, perhaps due to no API KEYS being provided???
  2. NOTE: I could not move past the welcome screen on the 64bit build due to no network being found (32bit worked)
@zchee
zchee / zhostrc
Created March 13, 2016 04:55 — forked from nhooyr/zhostrc
function vid2Gif {
if [[ $# != 3 ]]; then
print "too many or too less arguments"
return
fi
ffmpeg -y -i $1.mov -vf fps=10,scale=${2}:${3}:flags=lanczos,palettegen palette_$1.png
ffmpeg -i $1.mov -i palette_$1.png -filter_complex "fps=10,scale=${2}:${3}:flags=lanczos[x];[x][1:v]paletteuse" -f gif - | gifsicle --optimize=3 > $1.gif
}