Skip to content

Instantly share code, notes, and snippets.

View beratdogan's full-sized avatar

Berat Doğan beratdogan

View GitHub Profile
@jaytaph
jaytaph / example001.php
Created December 4, 2011 17:16
Examples for the iteratorAggregate blog
<?php
/*
* Example 1: Using iteratorAggregate
*/
// Simple class that represents our chapter
class Chapter {
protected $_title;
protected $_content;
@tsabat
tsabat / zsh.md
Last active December 25, 2023 19:16
Getting oh-my-zsh to work in Ubuntu
@gabrielgrant
gabrielgrant / testapp.py
Created February 9, 2012 01:43
Simple wsgi streaming response
pip install gunicorn
gunicorn testapp:app
@oodavid
oodavid / README.md
Last active June 12, 2024 00:28 — forked from aronwoost/README.md
Deploy your site with git

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/
@CristinaSolana
CristinaSolana / gist:1885435
Created February 22, 2012 14:56
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@neocotic
neocotic / analytics.coffee
Last active January 19, 2021 20:18
Google Chrome extension helpers
# (c) 2012 [neocotic](http://github.com/neocotic)
# Freely distributable under the MIT license.
# Private constants
# -----------------
# Code for extension's analytics account.
ACCOUNT = 'UA-12345678-1'
# Source URL of the analytics script.
SOURCE = 'https://ssl.google-analytics.com/ga.js'
@jlong
jlong / uri.js
Created April 20, 2012 13:29
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@swannodette
swannodette / gist:3217582
Created July 31, 2012 14:52
sudoku_compact.clj
;; based on core.logic 0.8-alpha2 or core.logic master branch
(ns sudoku
(:refer-clojure :exclude [==])
(:use clojure.core.logic))
(defn get-square [rows x y]
(for [x (range x (+ x 3))
y (range y (+ y 3))]
(get-in rows [x y])))
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active June 17, 2024 15:54
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@FrancisVarga
FrancisVarga / ReadMe.md
Created September 28, 2012 11:52
nginx config

Most of this configuration are default settings for easy start to work. Is configured for productive environment, depends of your application you have to tweak your config files!

Any hints for improve the configs are welcome!