This file contains hidden or 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 <errno.h> | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| #include <unistd.h> | |
| // header files for libpq | |
| #include <libpq-fe.h> | |
| #include <postgres_ext.h> | |
| #define OK 0 |
This file contains hidden or 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
| // example of file locking by cgo | |
| // Created by Masatoshi Fukunaga on 2019/02/14 | |
| package main | |
| import ( | |
| "fmt" | |
| "os" | |
| "os/signal" | |
| "syscall" |
This file contains hidden or 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
| # rewriting content history | |
| git filter-branch -f --tree-filter <script> --tag-name-filter cat -- --all | |
| # rewriting commit message history | |
| git filter-branch -f --msg-filter <script> --tag-name-filter cat -- --all |
This file contains hidden or 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
| #define USE_ROBIN_HOOD_HASH 1 | |
| #define USE_SEPARATE_HASH_ARRAY 1 | |
| template<class Key, class Value> | |
| class hash_table | |
| { | |
| static const int INITIAL_SIZE = 256; | |
| static const int LOAD_FACTOR_PERCENT = 90; | |
| struct elem |
This file contains hidden or 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
| #!/bin/sh | |
| # | |
| # this script create a luarocks manifest file | |
| # .git/hooks/pre-commit | |
| # | |
| if git rev-parse --verify HEAD >/dev/null 2>&1 | |
| then | |
| against=HEAD | |
| else | |
| # Initial commit: diff against an empty tree object(MAGIC number) |
This file contains hidden or 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
| // mah0x211's vscode user settings | |
| { | |
| // appearance settings | |
| "breadcrumbs.enabled": true, | |
| "window.zoomLevel": 0, | |
| // "editor.wordWrap": false, | |
| "workbench.colorTheme": "Quiet Light", | |
| "workbench.sideBar.location": "left", | |
| // font settings |
This file contains hidden or 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
| /* | |
| * Copyright 2015 Masatoshi Teruya. All rights reserved. | |
| * | |
| * Permission is hereby granted, free of charge, to any person obtaining a copy | |
| * of this software and associated documentation files (the "Software"), to deal | |
| * in the Software without restriction, including without limitation the rights | |
| * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| * copies of the Software, and to permit persons to whom the Software is | |
| * furnished to do so, subject to the following conditions: | |
| * |
This file contains hidden or 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
| typedef struct _grn_table_iter { | |
| grn_ctx *ctx; | |
| grn_table_cursor *cur; | |
| } grn_table_iter; | |
| grn_rc grn_table_iter_init( grn_ctx *ctx, grn_table_iter *it ) | |
| { | |
| if( ( it->cur = grn_table_cursor_open( ctx, grn_ctx_db( ctx ), NULL, 0, | |
| NULL, 0, 0, -1, 0 ) ) ){ |
This file contains hidden or 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
| /* | |
| * siphash.c | |
| * | |
| * Created by Masatoshi Teruya on 13/08/06. | |
| * | |
| */ | |
| #include <unistd.h> | |
| #include <limits.h> | |
| #include <stdint.h> |
This file contains hidden or 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
| -- change string metatable | |
| do | |
| local meta = debug.getmetatable( '' ); | |
| meta.__index = function( str, field ) | |
| return nil; | |
| end | |
| meta.__add = function( op1, op2 ) | |
| local t1 = type( op1 ); | |
| local t2 = type( op2 ); | |
NewerOlder