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 | |
if [ -z "$2" ]; then | |
echo "Usage: ./convert_to_text.sh in.pdf out.txt"; | |
exit 1; | |
fi | |
INPUT=$1 | |
OUTPUT=$2 | |
TYPE=`file -b --mime-type "$INPUT"` |
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
with indexes as ( | |
select | |
t.relname as table_name, | |
i.relname as index_name, | |
array_agg(a.attname order by position(cast(a.attnum as text) in cast(ix.indkey as text)) asc) as column_names | |
from | |
pg_class t, | |
pg_class i, | |
pg_index ix, | |
pg_attribute a |
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
db.getCollectionNames().forEach(function(c) {s = db[c].stats(1024*1024*1024); if (s.size > 0) { printjson(s); }}) |
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
cd /app/ | |
wget http://www.freedesktop.org/software/fontconfig/release/fontconfig-2.10.91.tar.gz | |
cd fontconfig-2.10.91 | |
tar -xzf fontconfig-2.10.91.tar.gz | |
./configure | |
make | |
cd /app/ | |
wget http://poppler.freedesktop.org/poppler-0.22.1.tar.gz | |
tar -xzf poppler-0.22.1.tar.gz |
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 'gchart' | |
require 'json' | |
data = JSON.parse(IO.read('google-hit-results.json'))['result'] | |
totals = data.collect { |point| point['count'] } | |
labels = data.collect do |point| | |
point['_id']['date']['day'] | |
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
<?php | |
if (!user_access('post to twitter')) { | |
drupal_set_message("You don't have permission to post to our Twitter account, sorry!"); | |
} | |
else { | |
module_load_include('inc', 'twitter'); | |
function twitter_standalone_form() { | |
$form = twitter_post_form(); | |
$form['submit'] = array( |