Skip to content

Instantly share code, notes, and snippets.

View furkanayhan's full-sized avatar

Furkan Ayhan furkanayhan

View GitHub Profile
@furkanayhan
furkanayhan / rename.sh
Created June 5, 2017 08:03
find and rename all files
find . -name 'OLDFILENAMEPARTIAL*' -type f -exec bash -c 'mv "$1" "${1//OLDFILENAMEPARTIAL/NEWFILENAMEPARTIAL}"' -- {} \;
@furkanayhan
furkanayhan / init.coffee
Last active November 25, 2016 14:38
Atom Settings
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
@furkanayhan
furkanayhan / 0_reuse_code.js
Created September 28, 2015 06:41
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@furkanayhan
furkanayhan / gist:2a1d8ac5994992a0f925
Created July 3, 2014 12:29
Postgresql backup and restore (pg_dump - pg_restore)
pg_dump -h localhost -U USERNAME -f backup.dump DATABASENAME -Fc
pg_restore --verbose --clean --no-acl --no-owner -h localhost -U USERNAME -d DATABASENAME backup.dump
@furkanayhan
furkanayhan / Default (OSX).sublime-keymap
Last active October 26, 2017 11:19
My Sublime Text 3 Settings
[
{ "keys": ["super+h"], "command": "show_panel", "args": {"panel": "replace"} },
{"keys": ["super+shift+r"], "command": "reindent" , "args": {"single_line": false}},
{ "keys": ["super+shift+."], "command": "erb", "context":
[
{ "key": "selector", "operator": "equal", "operand": "text.html.ruby, text.haml, source.yaml, source.css, source.scss, source.js, source.coffee" }
]
},
{ "keys": ["alt+d"], "command": "goto_definition" },
{ "keys": ["alt+g"], "command": "jump_back" }
@furkanayhan
furkanayhan / blog_controller.rb
Last active February 3, 2016 11:22 — forked from petewarden/tumblrproxy.rb
You can mount your Tumblr Blog to your existing Rails app. Forked from: https://gist.github.com/petewarden/3950261
class BlogController < ApplicationController
def index
path = params[:path].to_s
source_url = 'http://yourblog.tumblr.com/' + path
source_content_type = ''
source_body = open(source_url) do |f|
source_content_type = f.content_type # "text/html"
f.read
end
if source_content_type == 'text/html'