Skip to content

Instantly share code, notes, and snippets.

🍛
I love curry 🍛

mattn mattn

🍛
I love curry 🍛
Block or report user

Report or block mattn

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View ezfilter.vim
function! s:fuzzy(lhs, rhs) abort
return a:lhs =~ join(map(split(a:rhs, '\zs'), "printf('[\\x%02x].*', char2nr(v:val))"), '')
endfunction
let g:asyncomplete_preprocessor =
\ [function('asyncomplete#preprocessor#ezfilter#filter')]
let g:asyncomplete#preprocessor#ezfilter#config = {}
let g:asyncomplete#preprocessor#ezfilter#config['*'] =
\ {ctx, items -> filter(items, 's:fuzzy(v:val.word, ctx.base) != 0')}
View GoKNN.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View Gorgonia-Example.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View benchstat.txt
name old req/s new req/s delta
Exec 329k ± 0% 324k ± 0% ~ (p=1.000 n=1+1)
Query 120k ± 0% 122k ± 0% ~ (p=1.000 n=1+1)
Params 109k ± 0% 109k ± 0% ~ (p=1.000 n=1+1)
Stmt 171k ± 0% 165k ± 0% ~ (p=1.000 n=1+1)
Rows 0.00 0.00 ~ (all equal)
StmtRows 3.09k ± 0% 2.99k ± 0% ~ (p=1.000 n=1+1)
name old time/op new time/op delta
CustomFunctions-4 8.60µs ± 0% 8.00µs ± 0% ~ (p=1.000 n=1+1)
View wc.c
#include <windows.h>
#include <stdio.h>
int
main(int argc, char* argv[]) {
HANDLE h = GetStdHandle(STD_OUTPUT_HANDLE);
CHAR_INFO ci[6] = {};
COORD buffer_size = { 6, 1 };
COORD start_coord = { 0, 0 };
SMALL_RECT sr = { 0, 0, 80, 25 };
@mattn
mattn / wc.c
Created Aug 17, 2019
WriteConsoleOutputW is broken on Windows 10
View wc.c
#include <windows.h>
#include <stdio.h>
int
main(int argc, char* argv[]) {
HANDLE h = GetStdHandle(STD_OUTPUT_HANDLE);
CHAR_INFO ci[3] = {};
COORD buffer_size = { 3, 1 };
COORD start_coord = { 0, 0 };
SMALL_RECT sr = { 0, 0, 80, 25 };
View main.go
package main
import (
"fmt"
"os"
"runtime"
"strconv"
)
type node struct {
View client.c
#ifdef _WIN32
# include <ws2tcpip.h>
# include <io.h>
#else
# include <sys/fcntl.h>
# include <sys/types.h>
# include <sys/socket.h>
# include <netinet/in.h>
# include <netdb.h>
# define closesocket(fd) close(fd)
View main.go
package main
import (
"fmt"
"strconv"
"github.com/mitchellh/go-z3"
)
func main() {
You can’t perform that action at this time.