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
http://stackoverflow.com/questions/22667401/postgres-json-data-type-rails-query | |
http://stackoverflow.com/questions/40702813/query-on-postgres-json-array-field-in-rails | |
#payload: [{"kind"=>"person"}] | |
Segment.where("payload @> ?", [{kind: "person"}].to_json) | |
#data: {"interest"=>["music", "movies", "programming"]} | |
Segment.where("data @> ?", {"interest": ["music", "movies", "programming"]}.to_json) | |
Segment.where("data #>> '{interest, 1}' = 'movies' ") | |
Segment.where("jsonb_array_length(data->'interest') > 1") |
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
{ | |
"Type" : "SubscriptionConfirmation", | |
"MessageId" : "0941b7b3-4797-44e5-8079-dbf8ef09793f", | |
"Token" : "2336412f37fb687f5d51e6e241d164b0533302ec696efc8f113cd2252ce8a925c1e44a3c4ca2984675da85b9bd8c05da85337beb1f24a9c659b22ed3a8cc682f3457c4ead28d392a40e5c35c0e9> | |
"TopicArn" : "arn:aws:sns:us-west-2:164053224164:email-list", | |
"Message" : "You have chosen to subscribe to the topic arn:aws:sns:us-west-2:164053224164:email-list.\nTo confirm the subscription, visit the SubscribeURL included in this message", | |
"SubscribeURL" : "https://sns.us-west-2.amazonaws.com/?Action=ConfirmSubscription&TopicArn=arn:aws:sns:us-west-2:164053224164:email-list&Token=REDACTED", | |
"Timestamp" : "2013-10-05T17:00:04.135Z", | |
"SignatureVersion" : "1", | |
"Signature" : "<REDACTED>" |
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/sh | |
### BEGIN INIT INFO | |
# Provides: nginx | |
# Required-Start: $all | |
# Required-Stop: $all | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: starts the nginx web server | |
# Description: starts nginx using start-stop-daemon |
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
function curry(fn) { | |
var args = [].slice.call(arguments, 1); | |
function curried(fnArgs) { | |
if (fnArgs.length >= fn.length) { | |
return func.apply(null, fnArgs); | |
} | |
return function () { | |
return curried(fnArgs.concat([].slice.apply(arguments))); |
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
# be sure to comment out the require 'capistrano/deploy' line in your Capfile! | |
# config valid only for Capistrano 3.1 | |
lock '3.2.1' | |
set :application, 'my-cool-application' | |
# the base docker repo reference | |
set :name, "johns-stuff/#{fetch(:application)}" |
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
/* | |
* Inspired by: http://stackoverflow.com/questions/4360060/video-streaming-with-html-5-via-node-js | |
*/ | |
var http = require('http'), | |
fs = require('fs'), | |
util = require('util'); | |
http.createServer(function (req, res) { | |
var path = 'video.mp4'; |
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
{{-- Define all our servers --}} | |
@servers(['staging' => '', 'production' => '']) | |
@setup | |
{{-- The timezone your servers run in --}} | |
$timezone = 'Europe/Amsterdam'; | |
{{-- The base path where your deployments are sitting --}} | |
$path = '/var/www/site.com/htdocs'; |
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
{ | |
"directory": "vendor/bower_components" | |
} |
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 | |
# Exit this bash script if any statement returns a non-true return value (same as: set -e) | |
set -o errexit | |
if [ -z "$1" ]; then | |
echo | |
echo "ERROR: Must pass parameter of absolute or relative path to directory where Wordpress is to be installed." | |
echo "USAGE: $0 path/to/public/html/dir" | |
echo |
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 | |
use Illuminate\Console\Command; | |
use Illuminate\Filesystem\Filesystem; | |
class ViewsCommand extends Command { | |
/** | |
* The console command name. | |
* | |
* @var string |
NewerOlder