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
list=(something/*/*.file) | |
echo 'my text' | tee echo "${list[@]}" | |
# one liner | |
list=(some/globbed/*/path/*.txt); echo 'my text' | tee echo "${list[@]}" |
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
results = ActiveRecord::Base.connection.execute( | |
'select d.github_source, e.* from | |
(select a.github_source, count(*) as count FROM | |
(SELECT DISTINCT github_source FROM assignments) as sources | |
INNER JOIN assignments as a ON sources.github_source = a.github_source group by a.github_source) as d | |
inner join assignments as e on d.github_source = e.github_source where d.count > 1;' | |
) | |
with_content_ids = [] | |
no_content_ids = [] |
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
.typeahead, | |
.tt-query, | |
.tt-hint { | |
width: 396px; | |
height: 30px; | |
padding: 8px 12px; | |
font-size: 24px; | |
line-height: 30px; | |
border: 2px solid #ccc; | |
-webkit-border-radius: 8px; |
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
# A function to create new github repos from the command line | |
# USE: gh repo-name | |
function gh () { | |
curl -s -u '<GITHUB_USERNAME>:<GITHUB_API_KEY>' https://api.github.com/user/repos -d "{\"name\":\"$1\"}" | sed -n '/"ssh_url"/p' | gawk 'match($0, /:{1}\s"(.*)"/, ary) {print ary[1]}' | pbcopy | |
} | |
# A function to create new github repos for a specific organization (defaults to private repos) | |
# USE: gho repo-name org-name |
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
[{ | |
"title": "Lab 1", | |
"github_full_name": "DEV-flatiron-school-curriculum/lab-1" | |
}, | |
{ | |
"title": "Lab 2", | |
"github_full_name": "DEV-flatiron-school-curriculum/lab-2" | |
}] |
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
body { | |
font-family: Helvetica, arial, sans-serif; | |
font-size: 14px; | |
line-height: 1.6; | |
padding-top: 10px; | |
padding-bottom: 10px; | |
background-color: white; | |
padding: 30px; } | |
body > *:first-child { |
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 'redcarpet' | |
# Custom handler that raises error. | |
# | |
module Redcarpet | |
module Render | |
class Crasher < HTML | |
def paragraph(text) | |
raise "Error!" | |
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/bash | |
sed -i 's/host all all 0.0.0.0\/0 md5/local all all md5\nhost all all 0.0.0.0\/0 md5/g' /etc/postgresql/9.3/main/pg_hba.conf |
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
CREATE USER :user WITH SUPERUSER PASSWORD :'password'; |
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/bash | |
/usr/bin/expect <<EOD | |
spawn git clone $REPO_URL $REPO_NAME | |
expect -re "(continue)" | |
send "yes\n" | |
expect eof | |
EOD |