Skip to content

Instantly share code, notes, and snippets.

pulketo

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
https://nosir.github.io/cleave.js/
@pulketo
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.
window.location.reload();
}
});
View gist:e1458a7353271f4e43ba9414a0f334a5
// array holding allowed Origin domains
$allowedOrigins = array(
'(http(s)://)?(www\.)?my\-domain\.com'
);
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
pulketo / extractNumbersString.php
Created Jan 31, 2019 — forked from lerua83/extractNumbersString.php
PHP - Extract numbers from a string: URL: http://stackoverflow.com/questions/6278296/extract-numbers-from-a-string 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);
print_r($matches);
@pulketo
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:
h2o: https://h2o.examp1e.net/configure/fastcgi_directives.html#fastcgi.connect
gwan:
lwan:
Json Restful Storage Engine:
https://kronuz.io/Xapiand/docs/quickstart/
FB PHP login:
https://github.com/justfede/php-simple-facebook-login
WP
https://docs.woocommerce.com/document/handle-multiple-regions-currencies-woocommerce/
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
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
https://mycolor.space/gradient
http://paletton.com/
You can’t perform that action at this time.