Skip to content

Instantly share code, notes, and snippets.

View amiroff's full-sized avatar

Metin Emiroğlu amiroff

View GitHub Profile
@Atem18
Atem18 / gist:4696071
Last active April 19, 2024 11:18 — forked from evildmp/gist:3094281
Tutorial to seting up a django website in production.

Set up Django, Nginx and Gunicorn in a Virtualenv controled by Supervisor

Steps with explanations to set up a server using:

  • Virtualenv
  • Virtualenvwrapper
  • Django
  • Gunicorn
@ptaoussanis
ptaoussanis / free-port.clj
Created December 14, 2012 06:28
A little utility to allow simple redeployment of Clojure web servers with zero downtime, and without the need for a proxy or load balancer. Just wrap any port-binding calls, and the utility will auto kill pre-existing servers as necessary. *nix only. Based on the blog post by Feng Shen, http://shenfeng.me/fast-restart-clojure-webapp.html
;; (require '[clojure.string :as str] '[clojure.java.shell :as shell] '[taoensso.timbre :as timbre])
(defn with-free-port!
"Attempts to kill any current port-binding process, then repeatedly executes
nullary `bind-port!-fn` (which must return logical true on successful
binding). Returns the function's result when successful, else throws an
exception. *nix only.
This idea courtesy of Feng Shen, Ref. http://goo.gl/kEolu."
[port bind-port!-fn & {:keys [max-attempts sleep-ms]
@amiroff
amiroff / gist:4148511
Last active October 13, 2015 05:48
Clean up the crap of Ubuntu Gnome Remix
sudo apt-get purge gnome-games-* xdiagnose aisleriot gnome-dictionary gnome-contacts gnumeric abiword cheese alacarte rhythmbox alacarte
sudo apt-get autoremove
sudo apt-add-repository ppa:gnome3-team/gnome3
sudo apt-add-repository ppa:webupd8team/sublime-text-2
sudo add-apt-repository ppa:mystic-mirage/komodo-edit
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install sublime-text-2-dev dkms ppa-purge oracle-java6-installer
sudo apt-get install htop tmux screen software-center jockey-gtk git-core mercurial vim font-manager xclip vim tasksel
@amiroff
amiroff / Preferences.sublime-settings
Last active July 29, 2017 21:09
My Sublime Text User Preferences File
{
"always_prompt_for_file_reload": false,
"auto_complete": false,
"auto_complete_commit_on_tab": true,
"auto_find_in_selection": false,
"caret_style": "phase",
"color_scheme": "Packages/User/Themes/Mac CLassic.tmTheme",
"copy_with_empty_selection": false,
"default_line_ending": "unix",
"diff_changes_to_buffer": true,
@mardix
mardix / php-cs-fixer-pre-commit.php
Created September 4, 2012 17:06
A pre-commit hook to make PHP code PSR-2 compliant, check for syntax error
#!/usr/bin/php
<?php
/**
* .git/hooks/pre-commit
*
* This pre-commit hooks will check for PHP error (lint), and make sure the code
* is PSR compliant.
*
* Dependecy: PHP-CS-Fixer (https://github.com/fabpot/PHP-CS-Fixer)
*
@erikreagan
erikreagan / mac-apps.md
Created August 4, 2012 19:18
Mac developer must-haves

Mac web developer apps

This gist's comment stream is a collection of webdev apps for OS X. Feel free to add links to apps you like, just make sure you add some context to what it does — either from the creator's website or your own thoughts.

— Erik

@brandonb927
brandonb927 / osx-for-hackers.sh
Last active May 9, 2025 18:09
OSX for Hackers: Yosemite/El Capitan Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned.
#!/bin/sh
###
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer)
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos
###
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx
@gthomas
gthomas / gist:3152195
Created July 20, 2012 17:47
Django Doesn't Scale

Django doesn't scale and what you can do about it

Django doesn't scale Frameworks don't scale -- they're general purpose.

Development speed

Frameworks remove initial learning curve -- can get an application started in a day but you don't know what's going on. Productivity falls, and ramps back up.

@codeboost
codeboost / main.go
Created May 17, 2012 23:01
Source code for test scripts
package main
import (
"net/http"
"log"
"fmt"
)
func main() {
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
@axelav
axelav / gist:1839777
Created February 15, 2012 22:51 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt