This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
| # Source accepts http/https or the protocol region:// with the host as the bucket | |
| # access_key_id and secret_access_key are just that | |
| # Note resource name has changed from s3_file to s3_aware_remote_file | |
| # for the eu-west-1 region: | |
| s3_aware_remote_file "/var/bulk/the_file.tar.gz" do | |
| source "s3-eu-west-1://your.bucket/the_file.tar.gz" | |
| access_key_id your_key | |
| secret_access_key your_secret | |
| owner "root" |
Method overloading sucks in Scala because it detracts from your flexibility. An implicit conversion is a feature of Scala that let's the compiler look up how to convert objects between types at compile time.
Let's say I define a method with the following signature:
def doSomething( action: Action )
Somewhere else in the code I write:
| #!/usr/bin/env python | |
| # | |
| # s3-download.py - a quick-and-dirty download script to download from S3 | |
| # implemented using Boto, which automatically applies AWS IAM role credentials | |
| # | |
| # This code is distributed under the MIT license from | |
| # http://opensource.org/licenses/MIT: | |
| # | |
| # Copyright (c) 2013 Martijn Koster | |
| # |
| #!/bin/bash | |
| # update the system | |
| sudo apt-get --yes update | |
| sudo apt-get --yes upgrade | |
| # node.js using PPA (for statsd) | |
| sudo apt-get install --yes python-software-properties | |
| sudo apt-add-repository ppa:chris-lea/node.js | |
| sudo apt-get update --yes |
| #!/bin/bash | |
| # ******************************* | |
| # Instructions on turning this into an OSX service: | |
| # http://blog.lanceli.com/2012/08/downscale-screenshot-at-hight-resolution-on-retina-mackbook-pro.html | |
| # ******************************* | |
| # the path where screenshots to save | |
| DROPBOX_ID= ENTER YOUR DROPBOX ID HERE |
| #!/usr/bin/env python | |
| import boto.sqs | |
| from boto.sqs.message import RawMessage | |
| conn = boto.sqs.connect_to_region('us-east-1') | |
| q = conn.get_queue('tiles-data-processing-queue-stage') | |
| q.set_message_class(RawMessage) | |
| m = q.read() |
| console.log('Loading event'); | |
| var CLOUDSEARCH_ENDPOINT = < INSERT HERE > | |
| var async = require('async'); | |
| var jpath = require('json-path') | |
| var zlib = require('zlib'); | |
| var aws = require('aws-sdk'); | |
| var s3 = new aws.S3({ | |
| apiVersion: '2006-03-01' | |
| }); |
##motions
| motion | description |
|---|---|
| h | Count characters left |
| l | Count characters right |
| ^ | To the first character of the line |
| $ | To the last character of the line |
| f<char> | To the counth character occurrence to the right. F<char> to the counth character occurrence to the left |
| t<char> | To 1 character just before the counth character occurrence to the right |
| T<char> | To 1 character just before the counth character occurrence to the left |
source:
curl https://gist.githubusercontent.com/rehandalal/bcd4818457b5697e1d9e98951de1713e/raw/3723219fe3ceb294d353bed1a8bf4692b59a6bc0/filtered-recipes.json | \
jq -c '.[] | {id: .id, slug: .latest_revision.arguments.slug, pref: .latest_revision.arguments.preferenceName, created: .latest_revision.date_created, creator : .latest_revision.creator | "\(.first_name) \(.last_name)", ft: .latest_revision.filter_expression}' | \
jq -c '. | "$$ \(.id) $$ \(.created) $$ \(.creator) $$ \(.slug) $$ \(.pref) $$ \(.ft) $$"' | sed 's/"//g' | sed 's/|/\|/g' | sed 's/\$\$/|/g' | sort
| id | created | creator | slug | pref name | filter expression |
|---|---|---|---|---|---|
| 311 | 2017-11-21T18:29:39.911418Z | null null | pref-flip-autofill-release-1405217-2-2 | extensions.formautofill.available | ( [normandy.userId] |