Skip to content

Instantly share code, notes, and snippets.

View c0ze's full-sized avatar
🏠
Working from home

Arda Karaduman c0ze

🏠
Working from home
View GitHub Profile
@c0ze
c0ze / deploy.sh
Created December 15, 2014 05:18
Deploy static version of Rails site to S3 bucket
#!/bin/bash
# This script generates a static version of your rails site
# and uploads it into specified S3 bucket
# in this case the site had only two static pages, index.html and dashboard.html
# you need to configure these in routes.rb
# PS: if you know any other cleaner way to do this, pls let me know.
# this is necessary for setting up rbenv/rvm
source /Users/coze/.bash_profile
### Keybase proof
I hereby claim:
* I am c0ze on github.
* I am coze (https://keybase.io/coze) on keybase.
* I have a public key whose fingerprint is 1E59 A9C5 7D0A A2FF E48F DF72 13BC 8AE4 E958 D3CC
To claim this, I am signing this object:
@c0ze
c0ze / gist:a21e98018299b51b275c
Created June 30, 2015 06:49
A gist to unzip photos packed by google takeout and put them into folders by date
require 'zip'
file_path = ARGV[0]
Zip::ZipFile.open(file_path) { |zip_file|
zip_file.each { |f|
date = f.name.split("/")[2].split(" ")[0]
name = f.name.split("/")[3]
p "date #{date} name #{name}"
f_path=File.join("GooglePhotos", date.split("-"), name)
@c0ze
c0ze / replace.sh
Created March 18, 2016 08:57
Recursive replace string in directory
find `pwd` -iname "*.go" -type f -exec sed -i '' 's:github.com/alecthomas/log4go:github.com/sujrd/log4go:g' {} +
@c0ze
c0ze / build.sh
Created April 10, 2016 11:39
shell script to compile a web/chrome app made with coffee-script / slim
TARGETDIR="./out"
rm -rf $TARGETDIR
# copy html
for file in $(find . -type f -name \*.html); do
dir="./$TARGETDIR/$(dirname ${file})"
mkdir -p "$dir"
cp $file "$dir/$(basename ${file%.*}).html"
@c0ze
c0ze / phash_deps.sh
Created April 22, 2016 02:28
phash dependencies for rasbian
sudo apt-get install libsndfile1 libsndfile1-dev libsamplerate0 libsamplerate0-dev libmpg123-0 libmpg123-dev cimg-dev
cat ./* | grep ALLIANZ | awk '{print $9}' | sed 's/,//g' | awk '{s+=$1}END{print s}'
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDj91qUnVGoIikbkS03nX87nHk59+Iuw23tSabigZIaybc3qwft9ZYSrVmuOKuR/VeBPPQDE+rgiZ26RUI37JxZNZFK0WF2hasW4f+VpksoxOHmNJ8XCrJAZGnneJAVdN7x0z4dVY5RU7+hIlO7QHaSc1eAZ1TKZAIeyDWGZt6bnbRiOEzZWVDRYFXZycmbDFwHt4y+Dp/VjyAMsur5v+L+GKLoftk/HiWAHSF5o1o6saIiwfs0GBqr6n9sBCRsBSFBgqtl833mekMfW4O1627AkpBoRzOjxAkO/7j7qLaGIiEw7EhqmDQIVgj0cqureljRMQKDoez0Rgx00yiUGlGV akaraduman@gmail.com
DOCKER=`which docker`
$DOCKER rm -v $($DOCKER ps -a -q -f status=exited)
$DOCKER rmi $($DOCKER images -f "dangling=true" -q)
$DOCKER volume rm $($DOCKER volume ls -qf dangling=true)
@c0ze
c0ze / .emacs
Created December 20, 2018 04:54
;; Added by Package.el. This must come before configurations of
;; installed packages. Don't delete this line. If you don't want it,
;; just comment it out by adding a semicolon to the start of the line.
;; You may delete these explanatory comments.
(package-initialize)
(require 'package) ;; You might already have this line
(add-to-list 'package-archives
'("melpa" . "https://melpa.org/packages/"))