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/gsl-shell -i | |
function clamp(n, min, max) | |
if n < min then return min end | |
if n > max then return max end | |
return n | |
end | |
ap = 420 |
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
-- Micro web framework for writing REST applications. | |
-- Made by @wolfiestyle | |
-- Last modified: 2015-02-01 | |
-- License: MIT/X11 | |
local error, ipairs, math_random, next, pairs, require, select, setmetatable, string_char, table_concat, tonumber, tostring, type, unpack = | |
error, ipairs, math.random, next, pairs, require, select, setmetatable, string.char, table.concat, tonumber, tostring, type, unpack | |
local stderr = io.stderr | |
local Request = require "wsapi.request" | |
local Response = require "wsapi.response" |
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/env wsapi.cgi | |
local fw = require "framework" | |
local app = fw.app.new() | |
app:setup_session("s3cret key") | |
local page_home = [[ | |
<!DOCTYPE html> | |
<html> |
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 <lua.h> | |
#include <lauxlib.h> | |
#ifdef _WIN32 | |
#include <windows.h> | |
#define EXPORT __declspec(dllexport) | |
#else | |
#include <sys/time.h> | |
#include <unistd.h> | |
#define EXPORT |
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
diff --git a/src/openssl.c b/src/openssl.c | |
index 99a1ec0..7dc19e2 100644 | |
--- a/src/openssl.c | |
+++ b/src/openssl.c | |
@@ -2988,7 +2988,7 @@ static int xc_getVersion(lua_State *L) { | |
static int xc_setVersion(lua_State *L) { | |
X509 *crt = checksimple(L, 1, X509_CERT_CLASS); | |
- int version = luaL_checkint(L, 2); | |
+ int version = luaL_checkinteger(L, 2); |
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/env lua | |
local eval | |
local global = { | |
["+"] = function(args) | |
local acc = 0 | |
for i = 1, #args do | |
acc = acc + args[i] | |
end | |
return acc |
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
template<class T>struct W{T v;W(T v):v(v){}}; template<class T>int f(T x){f(W<T>(x));} main(){f(0);} |
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
extern crate num; | |
use num::complex::Complex64; | |
use num::traits::{Zero, One}; | |
use std::env; | |
use std::io::{self, Write}; | |
use std::fs::File; | |
fn viewport(width: usize, height: usize, size: f64, center: Complex64) -> (f64, f64, f64, f64) | |
{ | |
let (w, h, s) = (width as f64, height as f64, size * 0.5); |
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
/** assign all views on R.id to member variables of the same name using reflection */ | |
private void findAllViews() | |
{ | |
Field[] r_fields = R.id.class.getDeclaredFields(); | |
for (Field f: r_fields) | |
{ | |
String name = f.getName(); | |
Field v; | |
try | |
{ |
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 std.stdio, std.array, std.string, std.conv, std.random; | |
enum { ORDER = 2, MAX_RESULT_WORDS = 20 } | |
void main() | |
{ | |
uint[string][string] dict; | |
string[] prev; | |
foreach (line; stdin.byLine()) | |
foreach (word; split(to!string(toLower(line)))) |
OlderNewer