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
package main | |
import ( | |
"bytes" | |
"fmt" | |
"runtime" | |
"strconv" | |
"time" | |
) |
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
# You don't need Fog in Ruby or some other library to upload to S3 -- shell works perfectly fine | |
# This is how I upload my new Sol Trader builds (http://soltrader.net) | |
# Based on a modified script from here: http://tmont.com/blargh/2014/1/uploading-to-s3-in-bash | |
S3KEY="my aws key" | |
S3SECRET="my aws secret" # pass these in | |
function putS3 | |
{ | |
path=$1 |
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
import java.net.* | |
def server = new ServerSocket(443, Integer.MAX_VALUE, InetAddress.getByName("dev.simbo.realties.s3.amazonaws.com")) | |
while(true) { | |
server.accept { socket -> | |
println "processing new connection..." | |
socket.withStreams { input, output -> | |
def reader = input.newReader() | |
def buffer = reader.readLine() |
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
export AWS_ACCESS_KEY_ID= | |
export AWS_SECRET_ACCESS_KEY= | |
TAG_NAME="Name" | |
INSTANCE_ID="`wget -qO- http://instance-data/latest/meta-data/instance-id`" | |
REGION="`wget -qO- http://instance-data/latest/meta-data/placement/availability-zone | sed -e 's:\([0-9][0-9]*\)[a-z]*\$:\\1:'`" | |
TAG_VALUE="`aws ec2 describe-tags --filters "Name=resource-id,Values=$INSTANCE_ID" "Name=key,Values=$TAG_NAME" --region $REGION --output=text | cut -f3`" | |
echo "hostname=$TAG_VALUE" |
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
sudo su | |
cd | |
curl -L https://www.opscode.com/chef/install.sh | bash | |
chef-solo -v | |
cd | |
rm -rf * | |
rm -rf .chef/ |
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
sudo su | |
cd | |
curl -L https://www.opscode.com/chef/install.sh | bash | |
chef-solo -v | |
cd | |
rm -rf * | |
rm -rf .chef/ |
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
curl -XPOST localhost:9200/skus/sku/_search -d '{ | |
"query":{ | |
"filtered":{ | |
"query":{ | |
"match_all":{ | |
} | |
}, | |
"filter":{ | |
"has_child":{ |
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
# UX para Developers - Referências | |
## Soluções prontas | |
- Bootstrap from Twitter (http://twitter.github.com/bootstrap) | |
- jQuery Mobile (http://www.jquerymobile.com) | |
- HTML 5 Boilerplate (http://html5boilerplate.com) | |
## Ferramentas |
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
(defn ltm | |
"Makes a clojure map from a given collection. lst should have an even number of elements" | |
[lst] | |
(reduce merge | |
(map (fn [l] {(keyword (str (first l))) (second l)}) (partition 2 lst)))) | |
;;kudos to @paulosuzart | |
;;user=> (ltm '(:a 1 :b 2 :c3 :d 4)) | |
;;{:c3 :d, :b 2, :a 1} |
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
(defn ltm | |
"Makes a clojure map from a given collection. lst should have an even number of elements" | |
[lst] | |
(reduce merge | |
(map (fn [l] { (first l) (second l) } ) (partition 2 lst)))) | |
;kudos to @paulosuzart | |
;user=> (ltm '(:a 1 :b 2 :c 3 :d 4)) | |
;{:d 4, :c 3, :b 2, :a 1} |
NewerOlder