root@test:~# ./listmap.test -test.v -test.bench="Benchmark.*" -test.benchtime=5s
=== RUN Test1
=== RUN Test2
=== RUN Test3
=== RUN TestRemove
=== RUN TestSequentialShort
--- PASS: TestSequentialShort (0.00 seconds)
This file contains 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 | |
cd /tmp | |
wget https://drone.io/github.com/PreetamJinka/fickle/files/fickle && chmod +x fickle | |
wget https://gist.github.com/PreetamJinka/8089942/raw/pyfickle.py | |
./fickle >/dev/null 2>&1 & | |
sleep 1 | |
python pyfickle.py | |
killall fickle |
This file contains 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 <stdlib.h> | |
#include <stdio.h> | |
struct list_node { | |
int val; | |
struct list_node* next; | |
}; | |
typedef struct list_node node_t; |
This file contains 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
/* | |
$ cc context.c && ./a.out | |
foo() - 1 | |
bar() - 1 | |
foo() - 2 | |
bar() - 2 | |
foo() - 3 | |
bar() - 3 |
This file contains 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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>gutterSettings</key> | |
<dict> | |
<key>background</key> | |
<string>#FFFFFF</string> | |
<key>divider</key> | |
<string>#000000</string> |
This file contains 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
package main | |
import ( | |
"sync" | |
"testing" | |
) | |
// BenchmarkPanicRecovery 1000000 1025 ns/op | |
func BenchmarkPanicRecovery(b *testing.B) { | |
buffer := []byte{0, 1, 2, 3} |
This file contains 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
package main | |
import ( | |
"log" | |
"syscall" | |
) | |
func htonsInt16(n int) int { | |
return int(int16(byte(n))<<8 | int16(byte(n>>8))) | |
} |
This file contains 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
package main | |
import ( | |
"github.com/PreetamJinka/sflow-go" | |
"github.com/PreetamJinka/udpchan" | |
"fmt" | |
"io/ioutil" | |
"net" | |
"runtime" |
This file contains 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
<? | |
$plans = array( | |
'tera' => array('12G', 256000, 2, '11750M'), | |
'peta' => array('25G', 512000, 4, '24500M'), | |
'exa' => array('50G', 1024000, 8, '49G'), | |
'zetta' => array('100G', 2048000, 8, '99G'), | |
'yotta' => array('200G', 4096000, 8, '199G') | |
); | |
$images = array( |
This file contains 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
#!/usr/bin/php | |
<? | |
$user = trim(`id -un`); | |
$hostname = trim(`hostname`); | |
declare(ticks = 1); | |
pcntl_signal(SIGTERM, "signal_handler"); | |
pcntl_signal(SIGINT, "signal_handler"); | |
function signal_handler($signal) { |