Skip to content

Instantly share code, notes, and snippets.

View githubnando's full-sized avatar
💤
I may be slow to respond.

Ernando José githubnando

💤
I may be slow to respond.
View GitHub Profile
@githubnando
githubnando / .gitignore
Last active April 5, 2017 14:52
Useful policies of .gitignore
# Just add any subfolder in uploads path with a .gitkeep file in it to
# ignore all the files except the directory
# this doesnt work
public_html/uploads/**/*
!/**/.gitkeep
# instead, name it every directory that needs to ignore files
public_html/uploads/moduleSuperCool/*
@githubnando
githubnando / file-ajax-download.md
Last active June 20, 2017 13:40
Downlaod a file without opening a new window/popup

HTML

<iframe name="downloadIframe" id="downloadIframe" style="display: none"></iframe>

JAVASCRIPT

downloadTriggered() {
          uri = '/api/v1/users?id=1',
 downloadLink = document.createElement('a');
@githubnando
githubnando / two-daterangepicker-dates.md
Last active February 22, 2017 12:53
Two date inputs synchronized

Two date inputs using daterangepicker and jQuery. If the first date gets an update, the second date will also suffer an update if the range of the first date is higher than the second one.

example

// this.dateRangePicker('#start_at_datepicker', '#start_at_form');
// this.dateRangePicker('#end_at_datepicker', '#end_at_form', true);

dateRangePicker(datepickerInputId, dateInputId, minDate = false) {
    let input = document.querySelector(dateInputId);
@githubnando
githubnando / mysqldump-ignoring-multiple-tables.sh
Last active July 17, 2017 13:49
mysqldump-ignoring-multiple-tables
#!/bin/bash
DB_HOST=""
DB_DATABASE=""
DB_USERNAME=""
DB_PASSWORD=""
read -r -d '' tableSizesQuery << EOF
SELECT
table_schema as 'Database',