This file contains 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
namespace :export do | |
desc "Prints seeds in a seeds.rb format" | |
task :seeds_format => :environment do | |
User.order(:id).all.each do |user| | |
# doesn't work on dreamhost | |
puts "User.create(#{user.serializable_hash.delete_if { |key, value| ['created_at','updated_at','id'].include?(key)}.to_s.gsub(/[{}]/,'')})" | |
end | |
end | |
end |
This file contains 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
// | |
// This is placeholder functionality for IE. | |
// | |
$('[placeholder]').focus(function() { | |
var input = $(this); | |
if (input.val() == input.attr('placeholder')) { | |
input.val(''); | |
input.removeClass('placeholder'); |
This file contains 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
## Ensure to load the imfile module to monitor a >nginx< log file | |
## Add in main rsyslog.conf | |
$ModLoad imfile | |
## Explicitly state file monitor interval - unsupported in old version - cheggit | |
# $InputFilePollingInterval 10 | |
## The file that you'd watch and log | |
$InputFileName /var/log/access_log | |
## Something to help you label the log entry - useful for filters |
This file contains 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
# /etc/rsyslog.conf Configuration file for rsyslog. | |
# | |
# For more information see | |
# /usr/share/doc/rsyslog-doc/html/rsyslog_conf.html | |
# | |
# Default logging rules can be found in /etc/rsyslog.d/50-default.conf | |
################# | |
#### MODULES #### |
This file contains 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
qsort [] = [] | |
qsort (p:xs) = (qsort lesser) ++ [p] ++ (qsort greater) | |
where | |
lesser = filter (< p) xs | |
greater = filter (>= p) xs | |
This file contains 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
#!/usr/bin/env ruby | |
# encoding: utf-8 | |
# | |
#、-〿⦅-・ | |
s = Array.new | |
s << '、' | |
s << '〿' | |
s << '⦅' | |
s << '・' |
This file contains 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
mkdir -p ~/Library/LaunchAgents | |
cp /usr/local/Cellar/postgresql/9.0.4/org.postgresql.postgres.plist ~/Library/LaunchAgents/. | |
launchctl load -w ~/Library/LaunchAgents/org.postgresql.postgres.plist |
This file contains 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 | |
$api_url = 'http://api.via.me/v1/post'; | |
$access_token = 'YOUR_ACCESS_TOKEN_HERE'; | |
$img_url = '/Users/newuser/foo/bar.jpg'; | |
$msg = 'test'; | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_HEADER, 0); | |
curl_setopt($ch, CURLOPT_VERBOSE, 0); |
This file contains 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 | |
grep '[\x{4E00}-\x{9FBF}|\x{3040}-\x{309F}|\x{30A0}-\x{30FF}]' test.txt |
This file contains 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
diff --git a/upload.js b/upload.js | |
index 6bd2d90..6b32b17 100644 | |
--- a/upload.js | |
+++ b/upload.js | |
@@ -20,7 +20,17 @@ airbrake = require('airbrake').createClient('b8aa2614cff629cff9e3a0bde1d061bc'), | |
// require('v8-profiler'); // only needed for dev | |
// create your express server | |
-var app = module.exports = express.createServer(); | |
+var hskey = fs.readFileSync('hacksparrow-key.pem'); |