This file contains hidden or 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
## Sublime Text 3 Serial key build is 3176 | |
> * Added these lines into /etc/hosts | |
127.0.0.1 www.sublimetext.com | |
127.0.0.1 license.sublimehq.com | |
> * Used the license key | |
----- BEGIN LICENSE ----- |
This file contains hidden or 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
# delete local tag '12345' | |
git tag -d 12345 | |
# delete remote tag '12345' (eg, GitHub version too) | |
git push origin :refs/tags/12345 | |
# alternative approach | |
git push --delete origin tagName | |
git tag -d tagName |
This file contains hidden or 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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" | |
En Linux, es necesario instalar la libreria pybarcode desde pip: | |
pip install pyBarcode | |
En este código se muestra como crear codigo de barras ean13, isbn13 y code39 | |
""" | |
This file contains hidden or 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
git config --global alias.superlog "log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all" |
This file contains hidden or 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 numberWithCommas = function(x) { | |
var parts = x.toString().split("."); | |
parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ","); | |
return parts.join("."); | |
} |
This file contains hidden or 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
//setup before functions | |
var typingTimer; //timer identifier | |
var doneTypingInterval = 5000; //time in ms, 5 second for example | |
var $input = $('#myInput'); | |
//on keyup, start the countdown | |
$input.on('keyup', function () { | |
clearTimeout(typingTimer); | |
typingTimer = setTimeout(doneTyping, doneTypingInterval); | |
}); |
This file contains hidden or 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 downloadFile() { | |
var blob = ""; | |
var xhr = new XMLHttpRequest(); | |
xhr.onload = function(){ | |
if (this.status == 200) { | |
blob = new Blob([xhr.response], { type: 'application/pdf' }); | |
var link = document.createElement('a'); |
This file contains hidden or 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 | |
if( ! function_exists('apache_get_modules')){ | |
phpinfo(); | |
exit; | |
} | |
$res = 'Module Unavailable'; | |
if(in_array('mod_rewrite',apache_get_modules())){ | |
$res = 'Module Available'; |
This file contains hidden or 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 | |
/** | |
* Sanitiza los HTML retirando script tags del codigo | |
* @param $html string cadena HTML a sanitizar | |
* @return string retorna cadena sanitizada | |
*/ | |
public static function sanitize_html($html){ | |
$dom = new DOMDocument(); | |
$dom->loadHTML($html); | |
$script = $dom->getElementsByTagName('script'); |
This file contains hidden or 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 | |
header("Access-Control-Allow-Credentials: true"); | |
header("Access-Control-Allow-Origin: *"); | |
header("Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS"); | |
header("Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, Authorization"); | |
?> |
NewerOlder