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 / 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__
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)
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);
@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 (
# 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 / 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
@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>
diff --git a/libguile/stime.c b/libguile/stime.c
index f430ca4..8b810a7 100644
--- a/libguile/stime.c
+++ b/libguile/stime.c
@@ -834,6 +834,10 @@ scm_init_stime()
#ifdef HAVE_POSIX_CPUTIME
{
+#ifdef __APPLE__
+ if (clock_gettime (CLOCK_PROCESS_CPUTIME_ID, &posix_run_time_base) == 0)
@zchee
zchee / ideviceenterrecovery.c
Created July 18, 2016 18:21
With this tool you can enter in recovery mode easily without adding your udid instead of the initial code from Libimobiledevice
/* gcc ideviceenterrecovery.c -o ideviceenterrecovery -limobiledevice */
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <libimobiledevice/libimobiledevice.h>
#include <libimobiledevice/lockdown.h>
static char *udid = NULL;
int main()
@zchee
zchee / musl-cross.rb
Created July 19, 2016 01:03 — forked from FiloSottile/README.md
Homebrew Formula for musl-based GCC cross-compilers.
class MuslCross < Formula
desc "Linux cross compilers based on musl libc"
homepage "https://github.com/richfelker/musl-cross-make"
head "https://github.com/richfelker/musl-cross-make.git"
bottle do
cellar :any_skip_relocation
end
option "with-arm-hf", "Build cross-compilers targeting arm-linux-musleabihf"