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
$ brew install python | |
$ sudo pip install ansible |
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
db.votes.aggregate([ | |
{ "$unwind": "$votes" }, | |
{ "$group" : {"_id": "$votes", "count": {"$sum": 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
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'exifr' | |
filename = ARGV.pop | |
exif = EXIFR::JPEG.new(filename) | |
puts exif.width |
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
#!/usr/bin/env ruby | |
require 'date' | |
require 'net/smtp' | |
$ACCESS_WRONG_STATUS_MIN = 400 | |
$ACCESS_WRONG_STATUS_MAX = 500 | |
$ACCESS_TIMERANGE_SEC = 3 | |
$ACCESS_COUNT_THRESHOLDS = 2 |
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 | |
#--------------------------------------------- | |
# EC2 SSH | |
# | |
# select target from instace list | |
#--------------------------------------------- | |
# | |
# ssh example) $ ec2ssh profile1 | |
# | |
# download file example) |
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 | |
#======================= | |
# | |
# IAM Switch Role Shell | |
# | |
#======================= | |
script_name=`basename $0` | |
INI_FILE=$HOME/.aws/config |
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
import cv2 | |
import sys | |
import os | |
class FaceCropper(object): | |
CASCADE_PATH = "data/haarcascades/haarcascade_frontalface_default.xml" | |
def __init__(self): | |
self.face_cascade = cv2.CascadeClassifier(self.CASCADE_PATH) |
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
from datetime import datetime | |
import math | |
import time | |
import numpy as np | |
import tensorflow as tf | |
from tensorflow.models.image.cifar10 import cifar10 | |
FLAGS = tf.app.flags.FLAGS | |
#cifar10.IMAGE_SIZE = 32 |
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 snakeToCamel(s) { | |
return s.replace(/(\-\w)/g, function(m){return m[1].toUpperCase();}); | |
} |