export GITHUB_REPO=hortonworks/hdc-cli
curl -s \
-H "Authorization: token $GITHUB_TOKEN" \
https://api.github.com/repos/$GITHUB_REPO/releases/latest \
| jq ".assets[]|[.name,.url][]" -r \
This file contains 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
// Simple function to add a menu option to the spreadsheet "Export", for saving a PDF of the spreadsheet directly to Google Drive. | |
// The exported file will be named: SheetName and saved in the same folder as the spreadsheet. | |
// To change the filename, just set pdfName inside generatePdf() to something else. | |
// Running this, sends the currently open sheet, as a PDF attachment | |
function onOpen() { | |
var submenu = [{name:"Save PDF", functionName:"generatePdf"}]; | |
SpreadsheetApp.getActiveSpreadsheet().addMenu('Export', submenu); | |
} |
This file contains 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
#!/usr/bin/env bash | |
# | |
# gh-dl-release! It works! | |
# | |
# This script downloads an asset from latest or specific Github release of a | |
# private repo. Feel free to extract more of the variables into command line | |
# parameters. | |
# | |
# PREREQUISITES | |
# |
This file contains 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
/* # OFFICIAL GITHUB BRAND COLORS | |
-------------------------------------------------------------------- | |
Official Github Brand Colors (August 20, 2015) from the | |
GitHub internal CSS framework (Primer) version 2.3.3 | |
Source URI: http://primercss.io/colors/ | |
1.a = Github Branding Color Swatches | |
-------------------------------------------------------------------- */ | |
.swatch-github-blue { | |
background-color:#4078c0; |
This file contains 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
// updated per harisrozak: | |
add_filter('woocommerce_checkout_update_order_review', 'clear_wc_shipping_rates_cache'); | |
function clear_wc_shipping_rates_cache(){ | |
$packages = WC()->cart->get_shipping_packages(); | |
foreach ($packages as $key => $value) { | |
$shipping_session = "shipping_for_package_$key"; |
This entire guide is based on an old version of Homebrew/Node and no longer applies. It was only ever intended to fix a specific error message which has since been fixed. I've kept it here for historical purposes, but it should no longer be used. Homebrew maintainers have fixed things and the options mentioned don't exist and won't work.
I still believe it is better to manually install npm separately since having a generic package manager maintain another package manager is a bad idea, but the instructions below don't explain how to do that.
Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.
This file contains 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
curl --header 'Authorization: token INSERTACCESSTOKENHERE' \ | |
--header 'Accept: application/vnd.github.v3.raw' \ | |
--remote-name \ | |
--location https://api.github.com/repos/owner/repo/contents/path | |
# Example... | |
TOKEN="INSERTACCESSTOKENHERE" | |
OWNER="BBC-News" | |
REPO="responsive-news" |
This file contains 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
$data = getData(); | |
$step = 100 / count($data); | |
$percent = 0; | |
echo 'Doing stuff with data: '; //padding at the end for the number | |
foreach($data as $row) | |
{ | |
// do stuff |
This file contains 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
<?php # -*- coding: utf-8 -*- | |
/** | |
* Plugin Name: T5 Parent Terms in body_class | |
* Description: Adds all parent terms of a term archive to <code>body_class()</code>. | |
* Version: 2012.0.14 | |
* Author: Fuxia Scholz | |
* License: MIT | |
* License URI: http://www.opensource.org/licenses/mit-license.php | |
*/ |
This file contains 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
<?php | |
/** | |
* | |
* Safe Search and Replace on Database with Serialized Data v2.0.1 | |
* | |
* This script is to solve the problem of doing database search and replace when | |
* developers have only gone and used the non-relational concept of serializing | |
* PHP arrays into single database columns. It will search for all matching | |
* data on the database and change it, even if it's within a serialized PHP | |
* array. |
NewerOlder