Skip to content

Instantly share code, notes, and snippets.

View everett1992's full-sized avatar

Caleb Everett everett1992

  • Amazon
  • Seattle WA
View GitHub Profile
export function foo () {
return 'foo';
}
export function bar () {
return 'bar';
}
# vim:filetype=config:tw=80:et
#
# This is sample ~/.stalonetrayrc, resembling default configuration.
# Remember: command line parameters take precedence.
#
# Directives introduced in 0.8 are marked with "NEW in 0.8"
#
####################################################################
#
# stalonetray understands following directives
module Main (main) where
not_div :: Int -> [Int] -> [Int]
not_div x xs = filter (\a -> a `mod` x == 0) xs
main = do
putStrLn $ show $ take 10 $ not_div 400 $ not_div 100 $ not_div 4 [1..]
@everett1992
everett1992 / k-squares.hs
Created August 14, 2014 23:21
I learned to program so I wouldn't have to do math anymore.
module Main where
square k = (k ^ 2)
red k = (square k) / 3
blue k = ((square k) - (red k)) / 4
-- Dirty integer check.
is_integer n = floor(n) == ceiling(n)
require 'test_helper'
describe FeedCache do
let(:feed_url) { "dummy feed" }
let(:ttl) { 1.hour }
# Stubs File methods to fake an feed file that may exist, and has an mtime.
def with_feed_that(exists: exists, is_fresh: is_fresh = false, &block)
require 'open-uri'
class FeedCache
# Where feeds should be downloaded to
@@cache_dir = Rails.configuration.feed_cache_dir
# How old a cached feed can be before it expires
@@default_ttl = Rails.configuration.feed_cache_ttl
def self.cached? feed, ttl=@@default_ttl
File.exist?(cache_file(feed)) && (File.mtime(cache_file(feed)) >= ttl.ago)
end
@everett1992
everett1992 / crack
Created June 12, 2014 16:21
Shh cracking attempts
-- Logs begin at Sun 2013-05-19 13:01:58 EDT, end at Thu 2014-06-12 12:09:48 EDT. --
Jun 11 14:47:01 ragnarok systemd[1]: Starting OpenSSH Daemon...
Jun 11 14:47:01 ragnarok systemd[1]: Started OpenSSH Daemon.
Jun 11 14:47:01 ragnarok sshd[476]: Server listening on 0.0.0.0 port 22.
Jun 11 14:47:01 ragnarok sshd[476]: Server listening on :: port 22.
Jun 11 14:47:26 ragnarok sshd[1065]: Accepted publickey for caleb from 98.110.68.192 port 51767 ssh2: RSA 11:34:a0:3d:17:fa:95:3d:81:2d:58:ee:22:4e:fa:5a
Jun 11 14:47:26 ragnarok sshd[1065]: pam_unix(sshd:session): session opened for user caleb by (uid=0)
Jun 11 14:51:27 ragnarok sshd[1654]: Accepted publickey for caleb from 192.168.1.3 port 40759 ssh2: RSA 11:34:a0:3d:17:fa:95:3d:81:2d:58:ee:22:4e:fa:5a
Jun 11 14:51:27 ragnarok sshd[1654]: pam_unix(sshd:session): session opened for user caleb by (uid=0)
Jun 11 14:52:43 ragnarok sshd[1788]: Accepted password for wemux from 98.110.68.192 port 51796 ssh2

Programming languages Ruby Project One

Caleb Everett

When you are logged into github.com you can see a list of your followers recent activity. I'd like to summuraize that activity so I can quickly see what my followers are working on, and how much they are using github.

  1. Implements a simple spider to scrape web pages for some specific data.

I will use the Nokogiri gem to parse the

#Print the contents of a 16 element array, four at a time, using just each.
puts "Challenge 1\n\n"
(1..16).each_slice(4) {|nums| p nums}
puts puts
#Let the initializer of tree accept a nested structure of hashes
#example input: {'grandpa' => {'dad' => 'child 1' => {}, 'child 2' => {} }, 'uncle' => {'child 3' => {}, 'child 4' => {} } } }
#!/bin/env ruby
module ActsAsCsv
include Enumerable
def self.included(base)
base.extend ClassMethods
end
module ClassMethods
def acts_as_csv