Skip to content

Instantly share code, notes, and snippets.

View dreikanter's full-sized avatar

Alex Musayev dreikanter

View GitHub Profile
@dreikanter
dreikanter / README.md
Last active August 29, 2015 13:57
Fixed Cousera Downloader

This is quick and dirty fix for coursera-dl script. Put courseradownloader.py into site-packages and execute like this:

python -m courseradownloader -u username@gmail.com -p supersecret -d . behavioralecon-002
@dreikanter
dreikanter / s3-access-policy.json
Last active August 29, 2015 13:57
IAM user configuration to grant access to a specific bucket at Amazon S3
{
"Statement": [
{
"Effect": "Allow",
"Action": "s3:ListAllMyBuckets",
"Resource": "arn:aws:s3:::*"
},
{
"Effect": "Allow",
"Action": "s3:*",
@dreikanter
dreikanter / wishlist-2014.md
Last active August 29, 2015 14:02
My Wishlist 2014
@dreikanter
dreikanter / gist:2239150ccfa518429c22
Created August 24, 2014 14:41
Rack::Request object environment variables example
#<Rack::Request:0x007f92241da138
@env=
{"GATEWAY_INTERFACE"=>"CGI/1.1",
"PATH_INFO"=>"",
"QUERY_STRING"=>"",
"REMOTE_ADDR"=>"127.0.0.1",
"REMOTE_HOST"=>"localhost",
"REQUEST_METHOD"=>"GET",
"REQUEST_URI"=>"http://localhost:9292/sum/1/b",
"SCRIPT_NAME"=>"/sum/1/b",
@dreikanter
dreikanter / README.md
Last active August 29, 2015 14:10
Setting up Beyound Compare 4 as diff/merge tool for SVN console client on OS X

Beyond Compare 4 ❤️ SVN @ OS X

Put this to /usr/local/bin/bcdiff:

/usr/local/bin/bcompare "$6" "$7" -title1="$3" -title2="$5" -readonly
exit 0

Put his to /usr/local/bin/bcmerge:

/usr/local/bin/bcompare "$2" "$3" "$1" "$4"

@dreikanter
dreikanter / image_archive_action.rb
Last active August 29, 2015 14:10
File renaming action for Dropzone 3
# Dropzone Action Info
# Name: Archive Image
# Description: Save imge to specified forder, and rename it to YYYYMMDD format.
# Handles: Files
# Creator: Alex Musayev
# URL: http://yoursite.com
# Events: Dragged
# KeyModifiers: Command, Option, Control, Shift
# SkipConfig: No
# RunsSandboxed: Yes

HTTP status code symbols for Rails

1xx - Informational

Status Code Status Message Symbol
100 Continue :continue
101 Switching Protocols :switching_protocols
102 Processing :processing
@dreikanter
dreikanter / auth.rb
Created March 9, 2015 11:04
Facebook auth object
{
"provider" => "facebook",
"uid" => "1234567890",
"info" => {
"email" => "lwibbob_occhinoson_1234567890@tfbnw.net",
"name" => "Donna Amibecffjfgc Occhinoson",
"first_name" => "Donna",
"last_name" => "Occhinoson",
"image" => "http://graph.facebook.com/1234567890/picture",
"urls" => {
@dreikanter
dreikanter / topic-policy.json
Created September 25, 2015 15:26
SNS topic policy for S3 notifications
{
"Version": "2008-10-17",
"Id": "__default_policy_ID",
"Statement": [
{
"Sid": "__default_statement_ID",
"Effect": "Allow",
"Principal": {
"AWS": "*"
},
@dreikanter
dreikanter / Mediator.cs
Created May 14, 2012 09:12
Demo for two-class communication through the mediator.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;
namespace MediatorDemo
{
class Dispatcher
{