Skip to content

Instantly share code, notes, and snippets.

View rezigned's full-sized avatar

rezigned rezigned

View GitHub Profile
@rezigned
rezigned / shell-options.sh
Created April 2, 2012 17:11
Shell options reference
# Expressions
-a # file exists
-f # file exists and is a regular file
-h # file exists and is a symbolic link
-r # file exists and is readable
-w # ... and is writable
-x # ... and is executable
-S # ... and is a socket
# Special Vars
@rezigned
rezigned / gist:2469020
Created April 23, 2012 05:50
Regex for password validation
((?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[@#$%]).{7,20})
( # Start of group
(?=.*\d) # must contains one digit from 0-9
(?=.*[a-z]) # must contains one lowercase characters
(?=.*[A-Z]) # must contains one uppercase characters
(?=.*[@#$%]) # must contains one special symbols in the list "@#$%"
. # match anything with previous condition checking
{7,20} # length at least 7 characters and maximum of 20
<?php
namespace Money;
class Bitcoin {
#const BITCOIN_NODE = '173.224.125.222'; // w001.mo.us temporary
const BITCOIN_NODE = '50.97.137.37';
static private $pending = array();
public static function update() {
@rezigned
rezigned / greyscale.css
Created June 6, 2012 07:30
Apply greyscale to an image
/* http://snipplr.com/view/63328/
*
* First create a file filters.svg with the following contents
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" baseProfile="full" xmlns="http://www.w3.org/2000/svg">
<filter id="grayscale">
<feColorMatrix type="matrix" values="0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0"/>
</filter>
@rezigned
rezigned / README.md
Last active August 19, 2021 22:31
Simple deploy script

A simple script for deploy from git repository.

How it works

Assume we have the following project structures

$PROJECT_NAME:

Project name. This could be anything. for example sample

@rezigned
rezigned / dump-data.md
Last active December 10, 2015 03:08
MySQL commands

How to export data

# mysqldump -u {username} -p {database} > {filename}

mysqldump -u john -p mydb > mydb-dump.sql

How to export specific tables

@rezigned
rezigned / Makefile.md
Last active December 11, 2015 04:48
Troubleshooting

Makefile:6: *** missing separator. Stop.

This is because most Unix make programs require TABs not spaces.

Solution

Make sure to convert spaces to tab!

@rezigned
rezigned / install-sphinx-doc.md
Last active December 12, 2015 07:58
Installation & Setup

How to install Sphinx Doc and Create a new Project on OSX

Prerequisites

  • Xcode Command Line tools

Steps

# You might need to execute this command with 'root' previllage
@rezigned
rezigned / plugins.md
Last active December 14, 2015 15:19
VI Settings

NERDTree

NERDTree is a vim plugin that allows you to explore your filesystem/directories in the form of a tree.

Installation

NERDTree suggests that we should install it by using https://github.com/tpope/vim-pathogen. So, Let's install pathogen first.

mkdir -p ~/.vim/autoload ~/.vim/bundle; \
@rezigned
rezigned / centos.md
Last active December 16, 2015 13:29
Installing Graphite on OS X Mountain Lion & Cent OS
# Install EPEL
rpm -ivh http://mirror.us.leaseweb.net/epel/6/i386/epel-release-6-5.noarch.rpm

# Instll dependencies
yum install Django pycairo bitmap bitmap-fonts python-pip gcc python-devel mod_wsgi perl django-tagging

pip-python install carbon
pip-python install carbon
pip-python install whisper