Skip to content

Instantly share code, notes, and snippets.

@JamesKontargyris
JamesKontargyris / gist:360ec1668647195ba2ef874d42b79f0c
Created November 30, 2018 18:53
Git: fetch remote branch and force hard reset
git fetch --all
git reset --hard origin/master
OR If you are on some other branch
git reset --hard origin/your_branch
Explanation:
git fetch downloads the latest from remote without trying to merge or rebase anything.
Then the git reset resets the master branch to what you just fetched. The --hard option changes all the files in your working tree to match the files in origin/master
@JamesKontargyris
JamesKontargyris / style.css
Created November 28, 2018 13:35
CSS @font-face declaration
@font-face {
font-family: 'MyWebFont';
src: url('webfont.eot'); /* IE9 Compat Modes */
src: url('webfont.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('webfont.woff2') format('woff2'), /* Super Modern Browsers */
url('webfont.woff') format('woff'), /* Pretty Modern Browsers */
url('webfont.ttf') format('truetype'), /* Safari, Android, iOS */
url('webfont.svg#svgFontName') format('svg'); /* Legacy iOS */
}
@JamesKontargyris
JamesKontargyris / hideemail.php
Created April 18, 2016 18:45
PHP/JS Email Obfuscation
function hide_email($email)
{ $character_set = '+-.0123456789@ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz';
$key = str_shuffle($character_set); $cipher_text = ''; $id = 'e'.rand(1,999999999);
for ($i=0;$i<strlen($email);$i+=1) $cipher_text.= $key[strpos($character_set,$email[$i])];
$script = 'var a="'.$key.'";var b=a.split("").sort().join("");var c="'.$cipher_text.'";var d="";';