Skip to content

Instantly share code, notes, and snippets.

View josecaos's full-sized avatar
👹
filling squares

Jose Carlos Hasbun josecaos

👹
filling squares
View GitHub Profile
//avoid asking for pswd over http
//source: https://help.github.com/articles/caching-your-github-password-in-git/
git config --global credential.helper cache
git config --global credential.helper 'cache --timeout=3600'
@josecaos
josecaos / gist:4e41e1be04d53b8a0cb8eeb2c087f0c7
Created October 23, 2016 22:37
Actualiza submodulos de git
//git 1.7.2 ++
git submodule update --recursive --remote
@mixin prefix($name, $argument) {
-webkit-#{$name}: #{$argument};
-ms-#{$name}: #{$argument};
-moz-#{$name}: #{$argument};
-o-#{$name}: #{$argument};
#{$name}: #{$argument};
}
@mixin linear-gradient($fromColor, $toColor) {
background-color: $toColor; /* Fallback Color */
@josecaos
josecaos / gist:594ab6bbc79a4f3da6db1c85420f04cc
Last active June 27, 2018 06:28
python3 virtual enviroment
//Comand-line: Crea el ambiente de trabajo para localizar las dependencias del proyecto y seleccionar la version de python3
//default method
virtualenv -p python3 envname
//recomended method
python3 -m venv venvname
//start enviroment linux
source env/bin/activate
@josecaos
josecaos / gist:2c2227c543dbbf6be137a6ee9d512352
Created July 3, 2018 04:03
Find server's 'php.ini' file in use
php -i|grep 'php.ini'
@josecaos
josecaos / raspi3-config.txt
Last active July 17, 2018 05:58
Raspi3 force HDMI at boot
#This may work if your image does not boot with HDMI
#Edit system-boot/config.txt
#Force HDMI in raspberryPi 3
config_hdmi_boost=4
hdmi_mode=16
hdmi_force_hotplug=1
hdmi_drive=2
@josecaos
josecaos / public_ip.txt
Last active September 10, 2018 19:47
Public IP from terminal
// Only IP
dig +short myip.opendns.com @resolver1.opendns.com
// Or everything:
dig myip.opendns.com @resolver1.opendns.com
@josecaos
josecaos / on-sale.php
Last active December 20, 2018 19:46
Woocommerce on sale products page
From Woocommerce 3.3 you can use
[sale_products limit=’10’ paginate=’true’]
@josecaos
josecaos / js.copy.all.inside.some.div.html
Last active March 7, 2019 19:55
Copy all content from div
<div id="htmlcode" onclick="selectContent()">XXXXXXXXXXXXX</div>
<style>
function selectContent() {
const node = document.getElementById('htmlcode')
if (document.body.createTextRange) {
const range = document.body.createTextRange()
range.moveToElementText(node)
range.select()
document.execCommand('copy')
@josecaos
josecaos / arregla.permisos.docker.ubuntu.txt
Created August 23, 2019 19:32
Arragla permisos de docker
How to fix docker ‘Got permission denied while trying to connect to the Docker daemon socket’
Problem:
You are running a command like docker ps but you get this error message:
Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.39/containers/json: dial unix /var/run/docker.sock: connect: permission denied
Solution:
As a quick fix, running the command as root using sudo (e.g. sudo docker ps) will solve the issue temporarily.