Skip to content

Instantly share code, notes, and snippets.

upstream php-fpm {
server unix:/var/run/php5-fpm.sock;
}
server {
listen 80;
server_name www.example.com;
rewrite ^ http://example.com$request_uri?;
}
@teddypickerfromul
teddypickerfromul / gist:8070852
Created December 21, 2013 15:31
Не понял где ты не так делаешь
~ ➤ indent -st -bap -bli0 -i4 -l79 -ncs -npcs -npsl -fca -lc79 -fc1 -ts4 malloc_test.c
#include <stdlib.h>
#include <stdio.h>
#define N 5
void processMatrix(int **matrix);
void printMatrix(int **matrix)
{
#include <iostream>
#include <stdio.h>
#include <string.h>
#include <string>
#include <map>
#include <queue>
#include <set>
#include <algorithm>
#include <functional>
#include <cmath>
// -*- coding:utf-8-unix; mode:c; -*-
/*
get the active window on X window system
http://k-ui.jp/blog/2012/05/07/get-active-window-on-x-window-system/
*/
#include <stdlib.h>
#include <stdio.h>
#include <locale.h>
@teddypickerfromul
teddypickerfromul / chrome2keepassx.rb
Created March 17, 2013 18:01
Ruby: Convert Google chrome passwords sqlite database to KeepassX xml format.
# -*- encoding : utf-8 -*-
#!/usr/bin/env
begin
require 'sqlite3'
require 'date'
require 'time'
require 'getopt/long'
rescue LoadError => e
/* !Reset Module ------------------------------------------------------------ */
.reset div, .reset dl, .reset dt, .reset dd, .reset ul, .reset ol, .reset li, .reset h1, .reset h2, .reset h3, .reset h4, .reset h5, .reset h6,
.reset pre, .reset form, .reset fieldset, .reset p, .reset blockquote, .reset th, .reset td
{ margin: 0; padding: 0;}
.reset input, .reset textarea
{ margin: 0; font-size: 100%;}
.reset table
{ border-collapse: collapse; border-spacing: 0; font-size: 100%;}
.reset fieldset, .reset img, .reset abbr, .reset acronym
{ border: 0;}
@teddypickerfromul
teddypickerfromul / gist:5072556
Created March 2, 2013 18:58
bash: sexy promtp
PS1="\[\033[0;37m\]\342\224\214\342\224\200\$([[ \$? != 0 ]] && echo \"[\[\033[0;31m\]\342\234\227\[\033[0;37m\]]\342\224\200\")[$(if [[ ${EUID} == 0 ]]; then echo '\[\033[0;31m\]\h'; else echo '\[\033[0;33m\]\u\[\033[0;37m\]@\[\033[0;96m\]\h'; fi)\[\033[0;37m\]]\342\224\200[\[\033[0;32m\]\w\[\033[0;37m\]]\n\[\033[0;37m\]\342\224\224\342\224\200\342\224\200\342\225\274 \[\033[0m\]"