Skip to content

Instantly share code, notes, and snippets.

View chellberg's full-sized avatar

Corin Chellberg chellberg

View GitHub Profile
1662 grep -iC1 'refugee' fox_news_paragraphs.txt | sed '/^--$/d' > fox_news_refugee_paragraphs_4.txt
1663 grep -iA1 'refugee' fox_news_paragraphs.txt | sed '/^--$/d' > fox_news_refugee_paragraphs_5.txt
1664 vim MSNBC\ all.txt
1665 wc -l msnbc_paragraphs.txt
1666 wc -l MSNBC\ all.txt
1667 grep -iA1 'refugee' msnbc_paragraphs.txt | sed '/^--$/d' > msnbc_refugee_paragraphs.txt
1668 vim NPR_all.TXT
1669 wc -l msnbc_refugee_paragraphs.txt
1670 wc -l npr_paragraphs.txt
1671 wc -l NPR_all.TXT
@chellberg
chellberg / karabiner.json
Last active October 4, 2016 20:23
Karabiner-Elements karabiner.json to remap capslock to escape after macOS Sierra breaks your Seil https://github.com/tekezo/Karabiner-Elements
{
"profiles": [
{
"name": "Default profile",
"selected": true,
"simple_modifications": {
"caps_lock": "escape"
}
}
]
{
"name": "Web Starter Kit",
"short_name": "WSK",
"icons": [{
"src": "images/touch/icon-128x128.png",
"sizes": "128x128",
"type": "image/png"
}, {
"src": "images/touch/apple-touch-icon.png",
"sizes": "152x152",
GEM
remote: https://rubygems.org/
specs:
addressable (2.4.0)
capybara (2.7.1)
addressable
mime-types (>= 1.16)
nokogiri (>= 1.3.3)
rack (>= 1.0.0)
rack-test (>= 0.5.4)
@chellberg
chellberg / staging
Created May 27, 2015 20:16
5/27/15 RMS data fixes - rake commands and output
# NWR Naab Rd
heroku run bundle exec rake services:provider:category:remove[1332,CT] --remote staging
Running `bundle exec rake services:provider:category:remove[1332,CT]` attached to terminal... up, run.8969
config.eager_load is set to nil. Please update your config/environments/*.rb files accordingly:
* development - set it to false
* test - set it to false (unless you use a tool that preloads your test environment)
* production - set it to true
@chellberg
chellberg / counted_recurring_elements
Created May 1, 2015 18:18
indyrb interview problem
def counted_recurring_elements_in(array)
counts_by_number = array.inject({}) do |memo, element|
memo[element] = memo[element].to_i + 1 # I like this trick but I wish it didn't rely on knowing nil.to_i == 1
memo
end
recurring_counts_by_number = counts_by_number.select do |number, count|
count > 1
end
@chellberg
chellberg / 0_reuse_code.js
Last active August 29, 2015 14:20
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console