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 | |
# Simple way to get all your local branches up to date | |
# Ps: Add this to your .bash_profile or other file as a global helper | |
function _gitup(){ | |
branches=`git branch`; | |
current_branch=null; | |
git_status=`git status -s`; | |
has_stashed=false; |
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
/** | |
* A special function that runs when the spreadsheet is open, used to add a | |
* custom menu to the spreadsheet. | |
*/ | |
function onOpen() { | |
var spreadsheet = SpreadsheetApp.getActive(); | |
var menuItems = [ | |
{name: "Unquote.li / Generate mysql insert on update from selection", functionName: "unquoteGenMySqlInsert_"} | |
]; | |
spreadsheet.addMenu('MyHelpers', menuItems); |
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 hasClass(el, className) { | |
return el.classList ? el.classList.contains(className) : new RegExp('\\b' + className + '\\b').test(el.className); | |
} | |
function addClass(el, className) { | |
if (el.classList) el.classList.add(className); | |
else if (!hasClass(el, className)) el.className += ' ' + className; | |
} | |
function removeClass(el, className) { |
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
/** | |
* Global module | |
* @source https://addyosmani.com/resources/essentialjsdesignpatterns/book/ | |
*/ | |
var App = (function () { | |
// Module object | |
var module = {}, | |
privateVariable = "Hello World"; | |
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
# Put this file in folder /etc/cron.d/ | |
MAILTO="[email protected]" | |
0 1 * * * root /usr/local/sbin/certbot-renew.sh |
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
/** | |
* Simple regex to match domain even with new tlds and xn-- (internationnal domain names) | |
* @link tld list from http://data.iana.org/TLD/tlds-alpha-by-domain.txt sorted by extension length | |
*/ | |
var re = /(([a-z0-9-_\.]*)\.([a-z0-9-_]+)\.(XN--VERMGENSBERATUNG-PWB|XN--VERMGENSBERATER-CTB|XN--CLCHC0EA0B2G2A9GCD|TRAVELERSINSURANCE|XN--MGBERP4A5D4AR|XN--XKC2DL3A5EE0H|XN--XKC2AL3HYE2A|XN--KCRX77D1X4A|XN--MGBC0A9AZCG|SANDVIKCOROMANT|XN--I1B6B1A6A2E|XN--NQV7FS00EMA|XN--MGBA3A4F16A|XN--LGBBAT1AD8J|XN--MGBX4CD0AB|XN--MGBA3A3EJT|XN--FIQ228C5HS|XN--MGBBH1A71E|XN--B4W605FERD|XN--MGBAAM7A8H|XN--MGBAYH7GPA|XN--MGBB9FBPOB|XN--JLQ61U9W7B|CANCERRESEARCH|WEATHERCHANNEL|XN--6QQ986B3XL|XN--YGBI2AMMX|INTERNATIONAL|XN--FZC2C9E2C|LIFEINSURANCE|SPREADBETTING|XN--YFRO4I67O|XN--ECKVDTC9D|XN--FPCRJ9C3D|XN--MGBT3DHD|XN--QCKA1PMC|XN--3E0B707E|XN--MK1BU44C|XN--80ASEHDB|VERSICHERUNG|XN--NGBC5AZD|XN--NGBE9E0A|CONSTRUCTION|XN--OGBPF8FL|PAMPEREDCHEF|SCHOLARSHIPS|XN--MGB9AWBF|XN--MGBAB2BD|XN--MGBPL2FH|XN--80ADXHKS|XN--42C2D9A|XN--G2XX48C|XN |
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
/** | |
* Found in http://mapbox.com footer (hover robot) | |
*/ | |
.element:hover { | |
-webkit-animation: rainbow 4s steps(36) infinite; | |
} | |
@-webkit-keyframes rainbow { | |
from { -webkit-filter:hue-rotate(10deg); } | |
to { -webkit-filter:hue-rotate(360deg); } |
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 | |
cat <<EOF > result.txt | |
Content 1 | |
Content 2 | |
Content 3 | |
Content 4 | |
EOF |
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
# SECTION BEGIN SubDomainOnFolder | |
RewriteEngine on | |
RewriteCond %{HTTP_HOST} ^(blog|preprod)\. | |
RewriteCond %{REQUEST_URI} !^/(blog|preprod)/ | |
RewriteCond %{DOCUMENT_ROOT}/%1 -d | |
RewriteRule ^(.*)$ %1/$1 [L] | |
# SECTION END SubDomainOnFolder |
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
<!-- as seen on http://openweb.eu.org/articles/html-media-capture --> | |
<form action="index.php" method="post" enctype="multipart/form-data"> | |
<input type="file" name="image" accept="image/*" capture /> | |
<input type="file" name="video" accept="video/*" capture /> | |
<input type="submit" value="Upload" /> | |
</form> |
NewerOlder