Skip to content

Instantly share code, notes, and snippets.

@KNIGHTTH0R
KNIGHTTH0R / sheets-api-test-part2.php
Created December 26, 2018 03:07 — forked from karlkranich/sheets-api-test-part2.php
(obsolete due to Google changes) PHP code to use the Google Spreadsheets API with an OAuth Service Account. For more info, see http://karl.kranich.org/google-sheets-api-php
<?php
// Section 5: edit a row
// You'll need to get the etag and row ID, and send a PUT request to the edit URL
$rowid = 'cre1l'; // got this and the etag from the table data output from section 3
$etag = 'NQ8VCRBLVCt7ImA.';
$url = "https://spreadsheets.google.com/feeds/list/$fileId/od6/private/full/$rowid";
$method = 'PUT';
$headers = ["Authorization" => "Bearer $accessToken", 'Content-Type' => 'application/atom+xml', 'GData-Version' => '3.0'];
$postBody = "<entry xmlns=\"http://www.w3.org/2005/Atom\" xmlns:gsx=\"http://schemas.google.com/spreadsheets/2006/extended\" xmlns:gd=\"http://schemas.google.com/g/2005\" gd:etag='&quot;$etag&quot;'><id>https://spreadsheets.google.com/feeds/list/$fileid/od6/$rowid</id><gsx:gear>phones</gsx:gear><gsx:quantity>6</gsx:quantity></entry>";
$req = new Google_Http_Request($url, $method, $headers, $postBody);
@KNIGHTTH0R
KNIGHTTH0R / gData-class.php
Created December 26, 2018 02:55 — forked from jhaus/gData-class.php
Saving Form Data to Google Spreadsheets Using PHP and the Google Docs API via: http://farinspace.com/saving-form-data-to-google-spreadsheets/
<?php
/*
Copyright (c) 2009 Dimas Begunoff, http://www.farinspace.com/
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
@KNIGHTTH0R
KNIGHTTH0R / vueSetup.md
Created December 25, 2018 06:01 — forked from nerdenough/vueSetup.md
macOS Setup for Vue

macOS setup for Vue

Install macOS :P

Install Homebrew

Open terminal and run the follow command to install the latest version of Homebrew. This will also install the XCode utils if you don't have them already installed.

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

@KNIGHTTH0R
KNIGHTTH0R / json.php
Created June 8, 2018 09:44 — forked from recked/json.php
Create a JSON file using PHP + MySQL
<?php
//http://stackoverflow.com/a/2467974
$query="SELECT * FROM tablename LIMIT 20";
$result=$mysqli->query($query)
or die ($mysqli->error);
//store the entire response
$response = array();
@KNIGHTTH0R
KNIGHTTH0R / CSS Hacks!
Created March 10, 2018 10:38 — forked from Awilum/CSS Hacks!
CSS Hacks for IE6, IE7, IE8, FireFox, Opera, Safari, Chrome!
/* IE8 Only */
.myClass {
color:red\0/;
padding:70px\0/;
}
/* IE 6 Only */
* html .myClass {
...
}
" Make IE Better Compatible "
<!--[if IE]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
======================================================
IE6 Only
==================
_selector {...}
// Transparent navbar
//
// Reset transparent navbar basics
@navbar-transparent-color: transparent;
@navbar-transparent-bg: transparent;
@navbar-transparent-border: transparent;
// Transparent navbar links
@navbar-transparent-link-color: #fff;
@navbar-transparent-link-hover-color: #fff;
@KNIGHTTH0R
KNIGHTTH0R / README.md
Created February 6, 2018 06:20 — forked from quagliero/README.md
Installing cpuminer-multi on macOS 10.13.2 (High Sierra)

Installing cpuminer-multi on macOS 10.13.2 (High Sierra)

This assumes you have brew installed and are comfortable using a terminal.

Following the guide on https://github.com/tpruvot/cpuminer-multi will likely lead to errors about invalid paths to OpenSSL, and neoscrypt errors to the tune of Undefined symbols for architecture x86_64 during the build. I managed to piece together different fixes into an installation that has worked for me. So I hope it works for you.

Requirements

Ensure a c compiler is installed. Type g++ in the terminal and continue with the xcode installation if necessary. If it prints clang: error: no input files, then you can proceed.

@KNIGHTTH0R
KNIGHTTH0R / docker-install-rpi3.md
Created January 30, 2018 11:55 — forked from tyrell/docker-install-rpi3.md
Installing latest Docker on a Raspberry Pi 3

Introduction

I wrote this gist to record the steps I followed to get docker running in my Raspberry Pi 3. The ARM ported debian version (Jessie) comes with an old version of docker. It is so old that the docker hub it tries to interact with doesn't work anymore :)

Hopefully this gist will help someone else to get docker running in their Raspberry Pi 3.

Installation

From original instructions at http://blog.hypriot.com/post/run-docker-rpi3-with-wifi/

@KNIGHTTH0R
KNIGHTTH0R / single-use-commerice-coupon-create.php
Created December 19, 2017 10:17 — forked from amanaplan/single-use-commerice-coupon-create.php
Create a single-use Commerce coupon programmatically
<?php
/**
* Create a single-use Commerce coupon programmatically
*/
// Get all available coupon types
// $types = commerce_coupon_get_types();
// Create a default coupon instance