Skip to content

Instantly share code, notes, and snippets.

View wuelcas's full-sized avatar

Wuelber Castillo wuelcas

  • Managua, Nicaragua
View GitHub Profile
@wuelcas
wuelcas / Make new site in homestead
Created March 16, 2017 01:48
Make new site in homestead
ssh into de the homestead box
execute: serve domain.app /home/vagrant/Code/path/to/public/directory
/*========== Mobile First Method ==========*/
/* Custom, iPhone Retina */
@media only screen and (min-width : 320px) {
}
/* Extra Small Devices, Phones */
@media only screen and (min-width : 480px) {
To list all the files in a commit:
git diff-tree --no-commit-id --name-only -r <commit-sha>
To edit/undo last commit
git commit -m "Something terribly misguided"
git reset HEAD~
<< edit files as necessary >>
git add ...
git commit -C ORIG_HEAD // keep same commit message
git commit -c ORIG_HEAD // edit commit message
@wuelcas
wuelcas / ngrok https command
Created September 5, 2017 16:53
Command to use ngrok as https
ngrok http -bind-tls=true -host-header=rewrite 3000
lsof -i tcp:3000
# to kill the process
kill -9 PID
ffmpeg -i audio-input-name.mp3 -ac 2 -codec:a libmp3lame -b:a 48k -ar 16000 audio-output-name.mp3
@wuelcas
wuelcas / paginated.js
Created November 17, 2021 14:07 — forked from jstott/paginated.js
lodash paginated items
function getPaginatedItems(items, page, pageSize) {
var pg = page || 1,
pgSize = pageSize || 100,
offset = (pg - 1) * pgSize,
pagedItems = _.drop(items, offset).slice(0, pgSize);
return {
page: pg,
pageSize: pgSize,
total: items.length,
total_pages: Math.ceil(items.length / pgSize),