Skip to content

Instantly share code, notes, and snippets.

View mvcaaa's full-sized avatar
🏠
Working from home

Andrey Astashov mvcaaa

🏠
Working from home
View GitHub Profile
<?PHP
if(!isset($_SESSION)){
if (rand(0,10) > 5) {
session_start();
} else {
Header("HTTP/1.1 301 Moved Permanently");
Header("Location: http://new.vsesvetodiody.ru//");
}
}
?>
@mvcaaa
mvcaaa / gist:5400276
Last active December 16, 2015 07:39
Simple tourdom parser
# Simple CLI tourdom.ru crawler/parser
# To exec: ruby index.rb
# (C) Astashov Andrey <mvc.aaa@gmail.com>
# require 'rubygems'
require 'restclient'
require 'nokogiri'
require 'digest/md5'
require 'time'
http://stackoverflow.com/questions/5772192/git-how-can-i-reconcile-detached-head-with-master-origin
First, lets clarify what HEAD is and what it means when it is detached.
HEAD is the symbolic name for the currently checked out commit. When HEAD is not detached (the “normal”1 situation: you have a branch checked out), HEAD actually points to a branch’s “ref” and the branch points to the commit. HEAD is thus “attached” to a branch. When you make a new commit, the branch that HEAD points to is updated to point to the new commit. HEAD follows automatically since it just points to the branch.
git symbolic-ref HEAD yields refs/heads/master
The branch named “master” is checked out.
git rev-parse refs/heads/master yield 17a02998078923f2d62811326d130de991d1a95a