brew install clamav
freshclam -v
vi /usr/local/etc/clamav/clamd.conf
# add line LocalSocket /tmp/clamd.socket
./usr/local/Cellar/clamav/0.99.2_1/sbin/clamd --config-file=/usr/local/etc/clamav/clamd.conf
ps aux | grep clam
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
### Keybase proof | |
I hereby claim: | |
* I am charlieegan3 on github. | |
* I am charlieegan3 (https://keybase.io/charlieegan3) on keybase. | |
* I have a public key whose fingerprint is 3DA9 3090 84D0 D854 FE09 8588 DB86 FF2D 25A9 6313 | |
To claim this, I am signing this object: |
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
//: Playground - noun: a place where people can play | |
import Darwin | |
import Foundation | |
enum Result<T> { | |
case Ok(T) | |
case Err(String) | |
} |
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 'json' | |
require 'open-uri' | |
require 'pry' | |
urls = [] | |
Dir.glob("general/*.json") do |f| | |
list = JSON.parse(File.open(f).read) | |
urls += list.select do |e| | |
e["file"] && e["file"]["filetype"].match(/jpg/) | |
end.map { |e| e["file"]["url_private_download"] } |
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
// question 1 | |
// Last element of a list | |
exception ListEmptyError of string | |
let last xs = | |
match xs with | |
|[] -> raise (ListEmptyError("List is empty")) | |
|x -> x |> List.rev |> List.head | |
[<EntryPoint>] |
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
-- q1: myLast | |
import Html exposing (text) | |
myLast : List a -> Result String a | |
myLast list = | |
Result.fromMaybe ("Can't get head of empty.") | |
<| List.head | |
<| List.reverse list | |
main = |
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 'socket' | |
socket = TCPSocket.new('0.0.0.0', 3000) | |
socket.write("hey") | |
p socket.recv(100) |
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
def sorted_dup_hash(array) | |
Hash[*array.inject(Hash.new(0)) { |h,e| h[e] += 1; h }. | |
select { |k,v| v > 1 }.inject({}) { |r, e| r[e.first] = e.last; r }. | |
sort_by {|_,v| v}.reverse.flatten] | |
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
require 'twitter' | |
TWITTER_CONSUMER_KEY = 'xxxx' | |
TWITTER_CONSUMER_SECRET = 'xxxx' | |
USERNAME = 'username' | |
FRIEND_COUNT = 200 #Max 200, I think. | |
TWEET_COUNT = 50 | |
START_INDEX = 68 #if you hit the rate limit start where you left off | |
twitter_client = Twitter::REST::Client.new do |config| |
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 'badfruit' | |
require 'guess' | |
require 'sexmachine' | |
d = SexMachine::Detector.new | |
bf = BadFruit.new("YOUR_RT_API_KEY") | |
movies = ["Hunger Games: Catching Fire","Gravity", "..." ] | |
total = movies.size.to_s |
NewerOlder