This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Sets the zoom to make the "wrapper" element fit the width of the page. | |
* | |
* $element is either a jQuery object -the wrapper- or directly the width of the wrapper in pixels. | |
* margin_perc (optional) is the percentage that will be left at both sides | |
* max_ratio (optional) is an upper limit to the zoom ratio | |
* | |
* This function does nothing if the original or the resulting width of the wrapper is greater than the <html> element. | |
* Dependencies: jQuery (any version will do) | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# runcommand.py | |
# Handy function that executes an external command in the shell | |
# and returns 3 values: exit code of the command, its standard output | |
# and its error output. | |
# If you run the script directly, an example is provided: | |
# first it will run a successful command and then one with errors | |
# (you may want to modify them if not running a Unix system). | |
import subprocess |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
if "%1"=="" goto blank | |
echo Squashing %1 commits... | |
git reset --soft HEAD~%1 | |
git log --format=%%B%%n --reverse "HEAD@{1}" -n %1 > _msg.txt | |
git commit -t _msg.txt | |
del _msg.txt | |
echo Done! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# set locale to utf8 | |
sudo apt-get install -y language-pack-en-base | |
# add php7 repo | |
sudo LC_ALL=en_US.UTF-8 add-apt-repository -y ppa:ondrej/php | |
# adding key for nodejs repo | |
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 68576280 | |
# add nodejs 7 repo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var remove = [ | |
'.global-nav', | |
'.avert', | |
'.content-heading', | |
'.content-banner__content-breadcrumb', | |
'.content-author', | |
'.post__footer', | |
'.avert--sticky', | |
'.layout__sidebar', | |
'.market-highlight', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var e = document.querySelector('.site-header'); | |
e.parentElement.removeChild(e); | |
e = document.querySelector('.site-footer'); | |
e.parentElement.removeChild(e); | |
e = document.querySelector('.blog-post__comments'); | |
e.parentElement.removeChild(e); | |
e = document.querySelector('.social-media-links'); | |
e.parentElement.removeChild(e); | |
e = document.querySelector('.blog-post'); | |
e.style.maxWidth = 'inherit'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// composer require guzzlehttp/guzzle jotaelesalinas/php-rwgen | |
require 'vendor/autoload.php'; | |
define('DATA_DIR', dirname(__FILE__) . '/data'); | |
$states = ['AL', 'AK', 'AZ', 'AR', 'CA', 'CO', 'CT', 'DE', 'DC', 'FL', 'GA', 'HI', 'ID', 'IL', 'IN', 'IA', 'KS', 'KY', 'LA', 'ME', 'MD', 'MA', 'MI', 'MN', 'MS', 'MO', 'MT', 'NE', 'NV', 'NH', 'NJ', 'NM', 'NY', 'NC', 'ND', 'OH', 'OK', 'OR', 'PA', 'RI', 'SC', 'SD', 'TN', 'TX', 'UT', 'VT', 'VA', 'WA', 'WV', 'WI', 'WY']; | |
$year_init = 1960; | |
$year_end = 2016; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var selectors = [ | |
'.metabar' | |
, 'main > article > header' | |
, '.js-stickyFooter' | |
, '.supplementalPostContent' | |
, '.js-postFooterPlacements' | |
, 'footer > .container > section' | |
, '.postActions' | |
, '.postPromotionWrapper' | |
, '.js-postFooterPlacements' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var selectors = [ '.SidebarMenu' , '.ActionBar' , '.TitleBar' , '.SidebarSocial' , '.social__top' , '.social__bottom']; | |
var e = false;for ( var i = 0, l = selectors.length; i < l; i++ ) { while (e = document.querySelector(selectors[i])) { e.parentElement.removeChild(e); }} | |
e = document.querySelectorAll('.Main');for ( var i = 0, l = e.length; i < l; i++ ) { e[i].style.margin = '2em';} | |
e = document.querySelectorAll('.Tutorial');for ( var i = 0, l = e.length; i < l; i++ ) { e[i].style.margin = '0'; e[i].style.padding = '0'; e[i].style.border = '0'; e[i].style.maxWidth = 'inherit';} | |
e = document.querySelector('body');e.style.backgroundImage = 'none';e = document.querySelector('body');e.style.backgroundColor = '#fff'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function read_from_console ($prompt) { | |
if ( function_exists('readline') ) { | |
$line = trim(readline($prompt)); | |
if (!empty($line)) { | |
readline_add_history($line); | |
} | |
} else { | |
echo $prompt; | |
$line = trim(fgets(STDIN)); | |
} |
OlderNewer