Skip to content

Instantly share code, notes, and snippets.

View dev4dev's full-sized avatar
💭
Beep Boop Beep

Alex Antonyuk dev4dev

💭
Beep Boop Beep
View GitHub Profile
@dev4dev
dev4dev / doc.md
Last active December 11, 2015 06:59
Git Rules

Git Configuration

Global ignore list

Проверить где у вас находится файл с глобальными правилами игнорирования можно коммандой

git config --global core.excludesfile

Если оказалось что у вас его нет, то выполняем следующие комманды:

cd ~
@dev4dev
dev4dev / redis
Created February 28, 2012 18:21
start/stop redis-server
#!/usr/bin/env ruby -wKU
redis_bin = %x[which redis-server].strip
redis_cli = %x[which redis-cli].strip
redis_pid = '/usr/local/var/run/redis.pid'
redis_cfg = '/usr/local/etc/redis.conf'
if File.exists? redis_pid
## stop redis
print 'stopping redis-server...'
@dev4dev
dev4dev / gist:1313553
Created October 25, 2011 17:22
pop file information from $_FILES array
function pop_file(&$files)
{
## single file
if (!is_array($files['name'])) {
$temp = $files;
$files = array('name' => array());
return $temp;
}
## as array
@dev4dev
dev4dev / Postgres
Created April 17, 2011 17:13
start/stop postgres
#!/usr/local/bin/ruby
if !File.exist?('/usr/local/var/postgres/postmaster.pid') && ARGV[0] == 'start'
p %x[pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start]
p 'PG Started'
end
if File.exist?('/usr/local/var/postgres/postmaster.pid') && ARGV[0] == 'stop'
%x[pg_ctl -D /usr/local/var/postgres stop -s -m fast]
p 'PG Stopped'
@dev4dev
dev4dev / .profile
Created November 10, 2014 18:45
Function for opening Xcode workspace/project
xc() {
WORKSPACE=$(ls -dt *.xcworkspace 2>/dev/null | head -n 1)
PROJECT=$(ls -dt *.xcodeproj 2>/dev/null | head -n 1)
if [[ $WORKSPACE != '' ]]; then
open $WORKSPACE
elif [[ $PROJECT != '' ]]; then
open $PROJECT
else
echo 'R U SROUS?'
fi