Skip to content

Instantly share code, notes, and snippets.

@Balamir
Balamir / gist:b12691e7aca61f4231a3de682b455e4e
Created February 13, 2018 23:38 — forked from stuart11n/gist:9628955
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@Balamir
Balamir / iterm2-solarized.md
Last active June 25, 2017 15:25 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Meslo powerline font + [Powerlevel9k] - (macOS)

Default

Default

Powerlevel9k

Powerlevel9k

@Balamir
Balamir / Responsive.js
Created June 6, 2017 22:08 — forked from vizath/Responsive.js
Create an object that you can listen on for screen sizes with incomplete Bootstrap example.
"use strict";
var EventEmitter = require('events').EventEmitter;
var CHANGE_EVENT = 'change';
var breakpoints = [0, 768, 992, 1200, Infinity];
var indexes;
var getSize = function() {
// http://stackoverflow.com/a/11744120/808657
@Balamir
Balamir / README.md
Created December 13, 2016 21:27
Deobfuscate free version of JavascriptObfuscator.com

Simple Javascript deobfuscator

Aims to deobfuscate the result of JavascriptObfuscator free version.

Run

To tun the script, you should have had node.js installed first. Requires node.js and following npm modules:

  • esprima
@Balamir
Balamir / py2php.py
Created June 23, 2016 10:07 — forked from reusee/py2php.py
Python to php translator, compile python script to php
import ast
from cStringIO import StringIO
import sys
INFSTR = '1e308'
def interleave(inter, f, seq):
seq = iter(seq)
try:
f(next(seq))
@Balamir
Balamir / wp-query-ref.php
Created June 15, 2016 09:23 — forked from luetkemj/wp-query-ref.php
WP: Query $args
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/3.9/src/wp-includes/query.php
*/
$args = array(
<!-- country codes (ISO 3166) and Dial codes. -->
<select name="countryCode" id="">
<option data-countryCode="GB" value="44" Selected>UK (+44)</option>
<option data-countryCode="US" value="1">USA (+1)</option>
<optgroup label="Other countries">
<option data-countryCode="DZ" value="213">Algeria (+213)</option>
<option data-countryCode="AD" value="376">Andorra (+376)</option>
<option data-countryCode="AO" value="244">Angola (+244)</option>
<option data-countryCode="AI" value="1264">Anguilla (+1264)</option>
<option data-countryCode="AG" value="1268">Antigua &amp; Barbuda (+1268)</option>
<script type="text/javascript">
(function () {
"use strict";
// once cached, the css file is stored on the client forever unless
// the URL below is changed. Any change will invalidate the cache
var css_href = './index_files/web-fonts.css';
// a simple event handler wrapper
function on(el, ev, callback) {
if (el.addEventListener) {
el.addEventListener(ev, callback, false);
@Balamir
Balamir / treehouse.sh
Last active August 29, 2015 14:06 — forked from yitsushi/treehouse.sh
#!/usr/bin/env sh
# If DEBUG environment variable is not defined set as false
if [[ "x${DEBUG}" == "x" ]]
then
DEBUG=false
fi
# Logger function. Display a message if DEBUG is true
logMessage() {
Array.prototype.toIterator = function*() {
for (var i = 0, l = this.length; i < l; i++) {
yield this[i]
}
}
Object.prototype.map = function*(lambda) {
for (var value of this) {
yield lambda(value)
}