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 <ev.h> | |
#include <unistd.h> | |
#include <stdio.h> | |
#include <fcntl.h> | |
#include <errno.h> | |
#include <string.h> | |
#include <strings.h> | |
void on_error(struct ev_loop * loop, ev_io * w) { |
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
/* | |
* Compile with: g++ -std=c++11 -Werror -O2 tube.cpp -o tube -lev | |
* | |
*/ | |
#include <ev++.h> | |
#include <functional> | |
#include <iostream> | |
#include <stdexcept> | |
#include <memory> |
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
if [ "$color_prompt" = yes ]; then | |
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;31m\]\u\[\033[01;33m\]@\[\033[01;36m\]\h \[\033[01;33m\]\w \[\033[01;35m\]\$ \[\033[00m\]' | |
else | |
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' | |
fi | |
unset color_prompt force_color_prompt | |
# If this is an xterm set the title to user@host:dir | |
case "$TERM" in | |
xterm*|rxvt*) |
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
local Fabric = {} | |
Fabric.__metatable = {} | |
setmetatable(Fabric, Fabric.__metatable) | |
local Class = {} | |
Class.__metatable = {} | |
setmetatable(Class, Class.__metatable) | |
function Class.__metatable:__call(classname) | |
local mt = { |
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
local class = require 'metaclass' | |
local class1 = class "Person" | |
print(class1) | |
function class.Person:sayHello( ... ) | |
print(self, "Hello!") | |
end | |
function class1:HelloMazafaka( ... ) |
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
-- Code was taken from http://leafo.net/guides/dynamic-scoping-in-lua.html | |
function dynamic(name) | |
local level = 2 | |
-- iterate over | |
while true do | |
if not debug.getinfo(level) then | |
-- check that we didn't leave the call-stack | |
break | |
end | |
local i = 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
local a_1 = 1 | |
local a_2 = 2 | |
local a_3 = 3 | |
local a_4 = 4 | |
local a_5 = 5 | |
local a_6 = 6 | |
local a_7 = 7 | |
local a_8 = 8 | |
local a_9 = 9 | |
local a_10 = 10 |
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
local _1 = 1 | |
local _2 = 2 | |
local _3 = 3 | |
local _4 = 4 | |
local _5 = 5 | |
local _6 = 6 | |
local _7 = 7 | |
local _8 = 8 | |
local _9 = 9 | |
local _10 = 10 |
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 "fmt" | |
type IFace interface { | |
Method() string | |
} | |
func TakingObject(i IFace) { | |
fmt.Println(i.Method()) |
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/luajit-5_1-2.1.0-beta3 | |
local print = print | |
local collectgarbage = collectgarbage | |
local pairs = pairs | |
local tostring = tostring | |
local module = module | |
do | |
for k in pairs(package) do |
OlderNewer