Skip to content

Instantly share code, notes, and snippets.

list=(something/*/*.file)
echo 'my text' | tee echo "${list[@]}"
# one liner
list=(some/globbed/*/path/*.txt); echo 'my text' | tee echo "${list[@]}"
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 = []
.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;
@loganhasson
loganhasson / github.sh
Last active August 29, 2015 14:07
Create GitHub repos from the command line
# 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
[{
"title": "Lab 1",
"github_full_name": "DEV-flatiron-school-curriculum/lab-1"
},
{
"title": "Lab 2",
"github_full_name": "DEV-flatiron-school-curriculum/lab-2"
}]
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 {
require 'redcarpet'
# Custom handler that raises error.
#
module Redcarpet
module Render
class Crasher < HTML
def paragraph(text)
raise "Error!"
end
#!/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
CREATE USER :user WITH SUPERUSER PASSWORD :'password';
#!/bin/bash
/usr/bin/expect <<EOD
spawn git clone $REPO_URL $REPO_NAME
expect -re "(continue)"
send "yes\n"
expect eof
EOD