Glide is the easiest way to create useful slide for all of your Gists.
- input key
<-
to go backward. - input key
->
to go forward.
#include <stdio.h> | |
#include <mruby.h> | |
#include <mruby/proc.h> | |
#include <mruby/data.h> | |
#include <mruby/compile.h> | |
#include <mruby/string.h> | |
#include <mruby/hash.h> | |
#include <mruby/variable.h> | |
static struct RProc *compile(mrb_state *mrb, const char *path) |
#include <sys/types.h> | |
#include <sys/stat.h> | |
#include <unistd.h> | |
#include <stdbool.h> | |
bool is_dir(const char *path) | |
{ | |
struct stat s; | |
if (lstat(path, &s) == -1) { | |
return false; |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <mruby.h> | |
#include <mruby/proc.h> | |
#include <mruby/array.h> | |
#include <mruby/data.h> | |
#include <mruby/compile.h> | |
int main(int argc, char **argv) |
package main | |
import ( | |
"runtime" | |
) | |
func worker(done chan bool) { | |
// do something | |
location /mruby_regexp { | |
mruby_content_handler_code ' | |
re = Regexp.compile("(.)(.)") | |
re.match("ab") | |
result = Regexp.last_match.class == MatchData and | |
Regexp.last_match[0] == "ab" and | |
Regexp.last_match[1] == "a" and |
<?php | |
$id = 'testtest'; | |
$test_data = array(); | |
$mem = new Memcached; | |
$mem->addServer('/var/run/memcached.sock', 0); | |
if (count($argv) < 2) { | |
echo "few argument" . PHP_EOL; |
<?php | |
$id = 'testtest'; | |
$test_data = array(); | |
$mem = new Memcache; | |
$mem->connect('unix:///var/run/memcached.sock', 0, 10); | |
if (count($argv) < 2) { | |
echo "few argument" . PHP_EOL; |
location /modify_proxy_host { | |
# Hostヘッダが書き換わらない | |
# mruby_rewrite_handler_code ' | |
# hin = Nginx::Headers_in.new | |
# hin["Host"] = "localhost:8001" | |
# '; | |
# これなら書き換わる | |
mruby_set_code $proxy_host "'localhost:8001'"; |
$ go run rand.go | |
5 | |
$ go run rand.go | |
12 | |
$ go run rand.go | |
0 | |
$ |