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
object Stopwatch { | |
inline fun elapse(callback: () -> Unit): Long { | |
var start = System.currentTimeMillis() | |
callback() | |
return System.currentTimeMillis() - start | |
} | |
inline fun elapseNano(callback: () -> Unit): Long { | |
var start = System.nanoTime() |
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
public class Crc64 | |
{ | |
private static readonly ulong[] Table = { | |
0x0000000000000000, 0x7ad870c830358979, | |
0xf5b0e190606b12f2, 0x8f689158505e9b8b, | |
0xc038e5739841b68f, 0xbae095bba8743ff6, | |
0x358804e3f82aa47d, 0x4f50742bc81f2d04, | |
0xab28ecb46814fe75, 0xd1f09c7c5821770c, | |
0x5e980d24087fec87, 0x24407dec384a65fe, | |
0x6b1009c7f05548fa, 0x11c8790fc060c183, |
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
/* | |
* MarkdownSharp | |
* ------------- | |
* a C# Markdown processor | |
* | |
* Markdown is a text-to-HTML conversion tool for web writers | |
* Copyright (c) 2004 John Gruber | |
* http://daringfireball.net/projects/markdown/ | |
* | |
* Markdown.NET |
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/bash | |
server_id=`cat server.pid` | |
if kill -9 $server_id > /dev/null 2>&1; then | |
echo "Server killed" >&2 | |
fi | |
# start and banground server here | |
./server > /dev/null 2>&1 & |
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
# /etc/security/limits.conf | |
* soft nofile 999999 | |
* hard nofile 999999 | |
root soft nofile 999999 | |
root hard nofile 999999 | |
=========================================================== | |
# /etc/sysctl.conf | |
# sysctl for maximum tuning |
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
# Everything starting with a # is a comment | |
################################## 1-1-simple-example.rive | |
on: Hello bot | |
say: Hello human | |
################################## 1-2-replies.rive | |
# By default all statements live under start, this can be explicitly specified | |
start: | |
on: hello bot | |
say: |
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
function $range(...args) { | |
let [start, stop, step] = args | |
if (stop === undefined) { | |
stop = start | |
start = 0 | |
} | |
let direction = start < stop ? 1 : -1 | |
let i = start | |
step = step || (1 * direction) |
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 rascore | |
import ( | |
"testing" | |
"sync" | |
) | |
type info struct { | |
id int | |
} |
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
import inspect | |
class PipeFunction: | |
def __init__(self, func, *args, **kwargs): | |
self._func = func | |
self._args = args | |
self._kwargs = kwargs | |
def __call__(self, *args, **kwargs): | |
return self._append_params(*args, **kwargs) |
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
/** | |
* Copyright 2017 Zohaib Sibte Hassan | |
* 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: | |
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWAR |