Skip to content

Instantly share code, notes, and snippets.

View NuckChorris's full-sized avatar

Peter Lejeck NuckChorris

View GitHub Profile
class Arguments < Hash
def initialize (input)
if input.is_a? String
p input
@quote = false
@escape = false
@buffer = ''
@key = ''
input.each_char do |char|
require 'sold/module'
class System < Sold::Module
name 'System'
description 'Commands for managing the bot.'
help :restart, 'Restarts the bot.'
command :restart do |args, user|
user.can? :restart
respond 'Restarting...'
class Sold::Clause
def initialize (input)
if input.is_a? String
p input
# State flags and buffers
@quote = false
@escape = false
@buffer = ''
@key = ''
module ArtworksHelper
def thumbnail_for_artwork (artwork)
return content_tag(:figure, { :class => 'thumbnail' }) do
return "#{
return link_to artwork do
return image_tag(artwork.image_url(:thumb).to_s)
end
}#{
return content_tag(:caption) do
return "#{
local tags = { }
local statusbar = { }
local promptbox = { }
local taglist = { }
local layoutbox = { }
local settings = { }
local gears = require("gears")
local awful = require("awful")
awful.rules = require("awful.rules")
@NuckChorris
NuckChorris / .Xresources
Last active December 17, 2015 02:58 — forked from anonymous/.Xresources
! Enable alpha channel
URxvt.depth: 32
! Set base colors
URxvt.background: [80]#E7E7E7
URxvt.foreground: #30343A
URxvt.cursorColor: #30343A
! Scrollbar at right
URxvt.scrollColor: #d0d0d0
require 'rest_client'
require 'uri'
class VotingTokensController < ApplicationController
# TODO: Refactor this hideous beasts.
# Seriously, I really deserve to die for the awfulness herein contained.
def oauth_predirect
ApplicationController
# redirect_to "https://www.deviantart.com/oauth2/draft10/authorize?response_type=code&client_id
# =394&redirect_uri=http://test.emotecloud.net:3000/oauth/redirect"
var ioService = Components.classes['@mozilla.org/network/io-service;1'].getService(Components.interfaces.nsIIOService);
var scriptableStream = Components.classes['@mozilla.org/scriptableinputstream;1'].getService(Components.interfaces.nsIScriptableInputStream);
var input = ioService.newChannel("path/to/file", null, null).open();
scriptableStream.init(input);
var output = scriptableStream.read(input.available());
scriptableStream.close();
input.close();
// Do things with output
require 'multi_json'
require 'sold/index'
class Info < Sold::Module
help :info, "Outputs a JSON string of the bot config file."
command :info { |args| Sold::Config("bot").dump }
end
#!/bin/zsh
while
read data
do
if [[ -z $(echo $data | cut -f 3 -d :) ]]; then
echo "$(tput setaf 3)[Error] $filename: bitrate not found$(tput sgr0)"
else
bitrate=$(echo $data | sed -r "s/.*,\s+([0-9]*) kbps.*/\1/")
filename=$(echo $data | cut -f 1 -d :)