This file contains hidden or 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 rss | |
import "encoding/xml" | |
type Channel struct { | |
XMLName xml.Name `xml:"channel"` | |
Title string `xml:"title"` | |
Description string `xml:"description"` | |
Link string `xml:"url"` | |
LastBuildDate string `xml:"lastBuildDate"` |
This file contains hidden or 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
/* | |
MIT license: | |
Copyright (c) 2012 Harley Laue <[email protected]> | |
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 |
This file contains hidden or 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 <stdio.h> | |
#include <stdlib.h> | |
#include <libssh/libssh.h> | |
int main(int argc, const char *argv[]) { | |
char *host = "localhost", *username = "username", *password = "password"; | |
int port = 22, timeout = 5; | |
ssh_init(); | |
atexit((void(*)())ssh_finalize); |
This file contains hidden or 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 ret_code , n_jobs = ... | |
ret_code = tonumber ( ret_code ) | |
n_jobs = tonumber ( n_jobs ) or 0 | |
-- This MUST be updated to where ljsyscall is located | |
package.path = "/home/harley/Source/languages/lua/ljsyscall/?.lua;" .. package.path | |
local ljsyscall = require "syscall" | |
local getenv = os.getenv | |
local function cmd ( c ) |
This file contains hidden or 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
# useful for when you have multiple lua commands for different versions | |
for i in lua lua5.2 lua5.1 luajit; do | |
function $i() | |
{ | |
# Get Lua's version | |
local lua_version=$(command $0 -e "print(string.sub(_VERSION, -3))") | |
# Append to Lua's paths using normal shell variable interpolation | |
LUA_PATH=$(command $0 -e "print(package.path..';$HOME/.luarocks/share/lua/$lua_version/?.lua;$HOME/.luarocks/share/lua/$lua_version/?/init.lua;$HOME/.local/share/lua/$lua_version/?.lua;$HOME/.local/share/lua/$lua_version/?/init.lua')") \ | |
LUA_CPATH=$(command $0 -e "print(package.cpath..';$HOME/.luarocks/lib/lua/$lua_version/?.so;$HOME/.local/lib/lua/$lua_version/?.so')") \ | |
command $0 $* |
This file contains hidden or 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 | |
find /boot -type f -mtime +90 -and -name "vmlinuz*" | while read i; do dpkg -S $i; done | cut -d":" -f1 | xargs dpkg -r |
This file contains hidden or 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 markdown() | |
{ | |
lua5.1 <(echo "$(cat << EOLUA | |
discount=require("discount") | |
if #arg > 0 then | |
for _,v in ipairs(arg) do | |
local lines = "" | |
local f = io.open(v, "r") | |
if not f then | |
io.output(io.stderr):write(string.format([[%s: No such file or directory\n]], v)) |
This file contains hidden or 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
--[[ | |
DO NOT MAKE CHANGES TO THIS FILE! | |
This file will purposefully overwritten when moonc is run. However it provides | |
an easy way to do Moonscript development without having to use moonc to compile | |
to Lua. | |
]]-- | |
--[[ | |
License (MIT) |
This file contains hidden or 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 language SYSTEM "language.dtd"> | |
<!-- | |
By Harley Laue <[email protected]> | |
Based on the CoffeeScript syntax file by Max Shawabkeh ([email protected]) | |
and the Lua syntax file by Bruno Massa | |
--> | |
<language name="MoonScript" | |
version="1.0" |
This file contains hidden or 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
-- | |
-- Set a lock | |
-- | |
-- KEYS[1] - key | |
-- KEYS[2] - ttl in ms | |
-- KEYS[3] - lock content | |
{key, ttl, content} = KEYS | |
lockSet = redis.call 'setnx', key, content |
OlderNewer