Skip to content

Instantly share code, notes, and snippets.

View weechat-slack-irc.conf
/server add <name> <team>.irc.slack.com/6667 -ssl -password=<password>
/set irc.server.<name>.ssl_verify off
/set irc.server.<name>.nicks <username>
/connect <name>
View index.html
<!DOCTYPE html>
<meta charset="utf-8">
<style>
body {
font: 10px sans-serif;
}
</style>
View makeapp.sh
#!/bin/sh
echo "What should the Application be called (no spaces allowed e.g. GCal)?"
read inputline
name=$inputline
echo "What is the url (e.g. https://www.google.com/calendar/render)?"
read inputline
url=$inputline
View remove.rb
def remove_all_methods(definition)
lines = definition.lines.to_a
while idx = lines.find_index { |line, index| method_definition?(line) }
method_length = Pry::Code.new(lines).expression_at(idx + 1).lines.count
lines.slice!(idx, method_length)
end
lines.join
end
@AndrewVos
AndrewVos / TextAnalyzer-Ref
Created Sep 19, 2011 — forked from stuckinthecloud/gist:1227555
Refractored TextAnalyzer
View TextAnalyzer-Ref
#!/usr/bin/ruby
# Text Analyzer
# Author: Zach
# Purpose: Utilize Ruby to analyze Text files
# and generate statistical information therein.
require 'cgi'
STOPWORDS = File.read('conf/stop_words.txt').map{|x| x.chomp}
View example.rb
class WordReader
def initialize file
@file = file
end
def read_words
File.read(@filename).split(/\s+/)
end
end
class CommonWordRemover
You can’t perform that action at this time.