Skip to content

Instantly share code, notes, and snippets.


Block or report user

Report or block pulketo

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:8df4aa21af675c8877840a49bbc08a34
pulketo / gist:2a31beaa43687612aa08eea66fc59524
Created Feb 19, 2019
Javascript Html Reload if back button
View gist:2a31beaa43687612aa08eea66fc59524
window.addEventListener( "pageshow", function ( event ) {
var historyTraversal = event.persisted ||
( typeof window.performance != "undefined" &&
window.performance.navigation.type === 2 );
if ( historyTraversal ) {
// Handle page restore.
View gist:e1458a7353271f4e43ba9414a0f334a5
// array holding allowed Origin domains
$allowedOrigins = array(
if (isset($_SERVER['HTTP_ORIGIN']) && $_SERVER['HTTP_ORIGIN'] != '') {
foreach ($allowedOrigins as $allowedOrigin) {
if (preg_match('#' . $allowedOrigin . '#', $_SERVER['HTTP_ORIGIN'])) {
header('Access-Control-Allow-Origin: ' . $_SERVER['HTTP_ORIGIN']);
header('Access-Control-Allow-Methods: GET, PUT, POST, DELETE, OPTIONS');
pulketo / extractNumbersString.php
Created Jan 31, 2019 — forked from lerua83/extractNumbersString.php
PHP - Extract numbers from a string: URL: I want to extract the numbers from a string that contains numbers and letters like
View extractNumbersString.php
$str = 'In My Cart : 11 12 items';
preg_match_all('!\d+!', $str, $matches);
pulketo / Lubuntu, add new font | agregar font
Last active Jan 24, 2019
Lubuntu, add new font | agregar font
View Lubuntu, add new font | agregar font
put'em on: /usr/share/fonts/truetype/
sudo fc-cache -f -v
View gist:d511b704122518946f7de5f002271ccc
WebServer alternatives:
Json Restful Storage Engine:
FB PHP login:
View gist:45c25872ca409cd955281f0c77606d8e
remove first column
cat stuff.txt | awk '{$1=""}1' | awk '{$1=$1}1'
remove empty lines
cat stuff.txt | sed '/^$/d'
sed -i '/^$/d' stuff.txt
View gist:dd916561c367cfe5b2baac3b4d049e76
Actualizar una imagen (p.ej myssql)
docker pull mysql
docker stop my-mysql-container
docker rm my-mysql-container
docker run --name=my-mysql-container --restart=always -e MYSQL_ROOT_PASSWORD=mypwd -v /my/data/dir:/var/lib/mysql -d mysql
show current docker images running
docker ps
show last images running and stopped
pulketo / gist:952c8d047244e7b6fe6c4215a0993da5
Created Jan 14, 2019
Ajustar zona horarioa | Set / Get timezone Centos 7
View gist:952c8d047244e7b6fe6c4215a0993da5
REVIEW: timedatectl list-timezones
GET: timedatectl status
SET: timedatectl set-timezone America/Mexico_City
View gist:42f680cd527089c5e5c3d87fc0edc7e1
You can’t perform that action at this time.