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
| class Arguments < Hash | |
| def initialize (input) | |
| if input.is_a? String | |
| p input | |
| @quote = false | |
| @escape = false | |
| @buffer = '' | |
| @key = '' | |
| input.each_char do |char| |
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
| 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...' |
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
| class Sold::Clause | |
| def initialize (input) | |
| if input.is_a? String | |
| p input | |
| # State flags and buffers | |
| @quote = false | |
| @escape = false | |
| @buffer = '' | |
| @key = '' |
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
| 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 "#{ |
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 tags = { } | |
| local statusbar = { } | |
| local promptbox = { } | |
| local taglist = { } | |
| local layoutbox = { } | |
| local settings = { } | |
| local gears = require("gears") | |
| local awful = require("awful") | |
| awful.rules = require("awful.rules") |
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
| ! 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 |
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
| 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" |
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
| 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 |
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
| 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 |
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/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 :) |