This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function getJSON(aUrl,sheetname) { | |
| //var sheetname = "test"; | |
| //var aUrl = "http://pipes.yahoo.com/pipes/pipe.run?_id=286bbb1d8d30f65b54173b3b752fa4d9&_render=json"; | |
| var response = UrlFetchApp.fetch(aUrl); // get feed | |
| var dataAll = JSON.parse(response.getContentText()); // | |
| var data = dataAll.value.items; | |
| for (i in data){ | |
| data[i].pubDate = new Date(data[i].pubDate); | |
| data[i].start = data[i].pubDate; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Retrieves all the rows in the active spreadsheet that contain data and logs the | |
| * values for each row. | |
| * For more information on using the Spreadsheet API, see | |
| * https://developers.google.com/apps-script/service_spreadsheet | |
| */ | |
| function readRows() { | |
| var sheet = SpreadsheetApp.getActiveSheet(); | |
| var rows = sheet.getDataRange(); | |
| var numRows = rows.getNumRows(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| INSERT INTO admin_user SELECT | |
| NULL `user_id`, | |
| "Dung" `firstname`, | |
| "Pham" `lastname`, | |
| "dungpt@sutunam.com" `email`, | |
| "dungpt.sutunam" `username`, | |
| "9684dfd577831f73890e88fe18ca9072:Hs" `password`, | |
| NOW() `created`, | |
| NULL `modified`, | |
| NULL `logdate`, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| echo "////////////////////////// MAGENTO TAR ////////////////////////////" | |
| date | |
| DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
| excludefilename="$DIR/exclude_files.txt" | |
| day=$(date +%A) | |
| path=$1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Following on from other Gists I have posted, this one shows a neat way of using Includes to centralise general blocking rules for Bad Bots, creepy crawlers and irritating IPs | |
| see the full post at http://www.blue-bag.com/blog/apache-better-blocking-common-rules |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # General web stuff | |
| /.htaccess | |
| /robots.txt | |
| /sitemap.xml | |
| /*.sql | |
| /google*.html | |
| # Magento stuff | |
| app/etc/local.xml | |
| downloader/.cache |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** Build a menu item | |
| From https://developers.google.com/apps-script/guides/menus#menus_for_add-ons_in_google_docs_or_sheets | |
| **/ | |
| function onOpen(e) { | |
| var menu = SpreadsheetApp.getUi().createMenu('Sort'); | |
| if (e && e.authMode == ScriptApp.AuthMode.NONE) { | |
| // Add a normal menu item (works in all authorization modes). | |
| menu.addItem('Sort Sheet', 'sort'); | |
| } else { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # The initial version | |
| if [ ! -f .env ] | |
| then | |
| export $(cat .env | xargs) | |
| fi | |
| # My favorite from the comments. Thanks @richarddewit & others! | |
| set -a && source .env && set +a |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(tidyverse) | |
| library(analogsea) | |
| library(furrr) | |
| # R on local machine → DigitalOcean Linux image → Docker on that → R | |
| # Install analogsea, log into DigitalOcean, generate an API key with write | |
| # permissions, and add this line to ~/.Rprofile: | |
| # | |
| # Sys.setenv(DO_PAT = "KEY_GOES_HERE") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Disallow all crawlers access to certain pages. | |
| # Block Yandex from crawling site | |
| User-agent: Yandex | |
| Disallow: / | |
| # Block Yeti | |
| User-agent: Yeti | |
| Disallow: / |
OlderNewer