Where is apache?
$ which apachectl
It's not a symlink, so it must be mac version! Where's the confthing?
$ apachectl -V | grep conf
Where's PHP?
Where is apache?
$ which apachectl
It's not a symlink, so it must be mac version! Where's the confthing?
$ apachectl -V | grep conf
Where's PHP?
Guidelines
The callback way
async.parallel([
We need to host node ourselves (Rackspace server) to have access to the file system (temp files for image processing) and (legacy) local database.
Have you hosted node in production? If so, what was the web server setup? Currently, we're using nginx + a unix socket file + forever or upstart. My inclination is to stop hosting it ourselves and go for a PaaS (like heroku) - but that's because I wish this stuff was not my problem. What I'm looking for is a clear recipe for best practices.
Hosting node is hard because unhandled errors force the node.js v8 process to die and need a restart.
#!/usr/bin/env ruby | |
# foreman run script/social/auto-fbpost.rb data/crawl-data.json | |
# To get page access token, go to graph explorer, get user token with manage_pages and publish_actions permission, | |
# then request /{userId}/accounts | |
require 'koala' | |
require 'json' | |
graph = Koala::Facebook::API.new(ENV['FB_PAGE_ACCESS_TOKEN']) | |
urls = JSON.parse(File.open(ARGV.first).read) |
#!/usr/bin/env ruby | |
# foreman run script/social/auto-tweet.rb data/crawl-data.json | |
require 'Twitter' | |
require 'json' | |
client = Twitter::REST::Client.new do |config| | |
config.consumer_key = ENV['TWITTER_API_KEY'] | |
config.consumer_secret = ENV['TWITTER_API_SECRET'] | |
config.access_token = ENV['TWITTER_ACCESS_TOKEN'] | |
config.access_token_secret = ENV['TWITTER_ACCESS_TOKEN_SECRET'] |
<?php | |
$a = array(); | |
$b = $a; | |
// "When using the identity operator (===), object variables are identical | |
// if and only if they refer to the same instance of the same class." | |
if ($a === $b) print "same\n"; | |
$a['test'] = 'something'; |
var CoffeeScript = require('coffee-script') | |
// CoffeeScript.register() | |
function requireCoffeeScript(relativePath) { | |
var path = require('path'); | |
var fs = require('fs'); | |
relativePath = path.resolve(__dirname, relativePath); | |
console.log('relativePath', relativePath); | |
curl -d '{"name":"notch","agent":"minecraft"}' -H 'Content-Type: application/json' https://api.mojang.com/profiles | |
# http://skins.minecraft.net/MinecraftSkins/<USERNAME>.png for skin |
import SpriteKit | |
var str = "Hello, playground" | |
var dict : [String: String] = ["hi": "there"] | |
let productData = "{\"data\":[{\"url\": \"http://s2.img-b.com/build.com/imagebase/resized/330x320/moenimages/moen-tl182p-65.jpg\"}]}" | |
var error: NSError? |
# put this in /Users/adam/Library/Application Support/Sublime Text 3/Packages/User/babelfish.py | |
import sublime, sublime_plugin | |
class Bablefish(sublime_plugin.EventListener): | |
def on_modified(self, view): | |
print(view.file_name(), "modified") | |
w = view.window() | |