Skip to content

Instantly share code, notes, and snippets.

View sergixnet's full-sized avatar

Sergio Peña sergixnet

View GitHub Profile
git pull
git push
git branch
git commit
git checkout
git status
git log
git remote add <remote_name> </path/to/existing/repo>
git fetch <remote_name>
git merge <remote_name>/master
@sergixnet
sergixnet / Vagrantfile
Last active December 23, 2015 08:44
Vagrant shared forlders config on Vagrantfile with VVV
if vagrant_version >= "1.3.0"
config.vm.synced_folder "/Users/sudar/Dropbox/plugins/", "/srv/www/wordpress-default/wp-content/plugins", :owner => "www-data", :mount_options => [ "dmode=775", "fmode=774" ]
else
config.vm.synced_folder "/Users/sudar/Dropbox/plugins/", "/srv/www/wordpress-default/wp-content/plugins", :owner => "www-data", :extra => 'dmode=775,fmode=774'
end
@sergixnet
sergixnet / nodejs-raspbian
Created December 29, 2013 13:03
Nodejs instalakuntza Raspberry pi batean, Raspbian sistema eragilearekin
apt-get install python g++ make
mkdir ~/nodejs && cd $_
wget -N http://nodejs.org/dist/node-latest.tar.gz
tar xzvf node-latest.tar.gz && cd `ls -rd node-v*`
./configure
git config --global alias.lg "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"
@sergixnet
sergixnet / convert-images.sh
Created October 15, 2016 07:36
Generate different image sizes automatically, for use in html responsive images. Yo need to install imagemagick library first
#!/bin/bash
# script to generate image sizes for srcset
# generated images will be in ./output dir
mkdir -p output
# .jpg files, 1440 width size, adds an -xl in the name of the new ones, keeps the old ones
for i in *.jpg; do convert $i -resize 1440 ./output/$(basename $i .jpg)-xl.jpg; done
# move all files to cleaned directory
# Europe, USA, Japan, Spain
mv *\(E\)*\ \[\!\]* cleaned
mv *\(U\)*\ \[\!\]* cleaned
mv *\(J\)*\ \[\!\]* cleaned
mv *\(S\)*\ \[\!\]* cleaned
@sergixnet
sergixnet / json2yaml-md.py
Created February 14, 2017 16:07
Creating a markdown file from a dictionary, for use in Grav cms
# -*- coding: utf-8 -*-
import yaml
import html2text
import os
ROOT_DIR = os.getcwd()
dic = {
'title': 'My awesome title',
@sergixnet
sergixnet / yt-mp3
Created March 7, 2017 17:41
Download a youtube playlist in mp3
youtube-dl --extract-audio --audio-format mp3 https://www.youtube.com/playlist?list=<LIST_ID>
@sergixnet
sergixnet / bitbucket-pipelines.yml
Created May 17, 2017 10:01
Bitbucket pipelines
# You can specify a custom docker image from Docker Hub as your build environment.
image: samueldebruyn/debian-git
pipelines:
default:
- step:
script:
- apt-get update
- apt-get -qq install git-ftp
- git ftp init --user $FTP_USERNAME --passwd $FTP_PASSWORD ftp://youtftpsite.com/ftp-path/
# for the second push run this command instead of init