Skip to content

Instantly share code, notes, and snippets.

View exu's full-sized avatar
🔨
forging testkube

Jacek Wysocki exu

🔨
forging testkube
View GitHub Profile
@exu
exu / .ctags
Created April 22, 2013 12:14
My Emacs .ctags config file for PHP 5.4 based projects. Save it in project directory. (It needs exuberant-ctags package). I'm using it with etags-select package
-e
-f ./TAGS
--recurse
--languages=PHP
--exclude=.svn
--exclude=.git
--exclude="*/_*cache/*"
--exclude="*/_*logs{0,1}/*"
--exclude="*/_*data/*"
--totals=yes
@exu
exu / foo.md
Created November 22, 2012 14:23 — forked from legumbre/foo.md
resolving merge conflicts with magit-ediff

Use magit-ediff to resolve merge conflicts

Use magit-ediff or 'e' on an unmerged item to resolve merge conflicts with ediff. Magit will set up an ediff with three buffers A, B and C. A and B are the original (conflicting) files, and C is the conflicted merge.

Use 'n'/'p' to move to the next/previous conflict, use 'a'/'b' to choose which changes (those in a A or B) should be the ones to keep in the merged file.

You can always just switch to buffer C and edit what the merged version should look like.

#!/usr/bin/env php
<?php
class Cli {
private static $foreground_colors = array(
'black' => '0;30',
'dark_gray' => '1;30',
'blue' => '0;34',
'light_blue' => '1;34',
'green' => '0;32',
@exu
exu / xvfb
Created September 24, 2012 10:52
#!/bin/bash
if [ -z "$1" ]; then
echo "`basename $0` {start|stop}"
exit
fi
case "$1" in
start)
/usr/bin/Xvfb :99 -ac -screen 0 1024x768x8 &
@exu
exu / csvn
Created August 31, 2012 12:38
#!/bin/sh
echo "recursively removing .svn folders from"
pwd
rm -rf `find . -type d -name .svn`
a {
color: #101010;
color: #f13a21;
color: #93f91d;
color: #ffd00a;
color: #004f9e;
color: #ec0048;
color: #2aa7e7;
color: #f2f2f2;
color: #1d202f;
@exu
exu / copy_last_hour_files
Created July 31, 2012 10:59
Copy files to tmp/OUT/ dir which was modified hour ago
#!/usr/bin/env sh
find . -type f -mmin -60 -not -iwholename '*.svn*' -print0 | rsync -av --files-from=- --from0 ./ ~/tmp/OUT
<?php
$Password1 = 'WrongPassword';
$Password2 = 'SuperSecurePassword123';
$HashedPassword = '$6$rounds=100000$4fdf2f7b73a06$Puk8iouZuEqeuk70dnOZ/Ov67QrBm7pUwoaN9zi9rU2QkUJ/oDtobOMSzgRRy8VCnQz2caF/iakgclGILPC841';
// Now, what about checking if a password is the right password?
if (crypt($Password1, $HashedPassword) == $HashedPassword) {
echo "Hashed Password matched Password1";
} else {
<?php
$Password = 'SuperSecurePassword123';
// These only work for CRYPT_SHA512,
// but it should give you an idea of how crypt() works.
$Salt = uniqid(); // Could use the second parameter to give it more entropy.
$Algo = '6'; // This is CRYPT_SHA512 as shown on http://php.net/crypt
$Rounds = '999999999'; // The more, the more secure it is!
// This is the "salt" string we give to crypt().
group :development do
gem 'guard-livereload'
gem 'libnotify'
end