Skip to content

Instantly share code, notes, and snippets.

View leegee's full-sized avatar

Lee Goddard leegee

View GitHub Profile
@Ircama
Ircama / LgMagicRemoteKeys.md
Last active April 28, 2024 23:48
Replacing Netflix and Amazon keys of the webOS LG TV LG Magic Remote with other apps

Replacing Netflix and Amazon keys of the webOS LG TV LG Magic Remote with other apps

This procedure allows substituting one or both Netflix and Amazon keys of the Magic Remote Control Unit with other apps or TV control menus of the webOS LG TV.

Netflix and Amazon keys can be found just over the Red-Green-Yellow-Blue color buttons of such remote.

Assumption for this procedure is that you accept to uninstall the apps related to the keys to be substituted. Example: if you want to replace the Netflix key, you need to uninstall Netflix (possibly, you are not using Netflix if you do not need such key).

To uninstall Netflix or Amazon Prime, press the Home key of the Magic Remote, select the "LG Content Store" app, press "APP" at the top of the screen, press "My Apps", press the "Rem

/**
* 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();
@npearce
npearce / install-docker.md
Last active April 19, 2024 12:35
Amazon Linux 2 - install docker & docker-compose using 'sudo amazon-linux-extras' command

UPDATE (March 2020, thanks @ic): I don't know the exact AMI version but yum install docker now works on the latest Amazon Linux 2. The instructions below may still be relevant depending on the vintage AMI you are using.

Amazon changed the install in Linux 2. One no-longer using 'yum' See: https://aws.amazon.com/amazon-linux-2/release-notes/

Docker CE Install

sudo amazon-linux-extras install docker
sudo service docker start
@malarkey
malarkey / Contract Killer 3.md
Last active April 16, 2024 21:44
The latest version of my ‘killer contract’ for web designers and developers

When times get tough and people get nasty, you’ll need more than a killer smile. You’ll need a killer contract.

Used by 1000s of designers and developers Clarify what’s expected on both sides Helps build great relationships between you and your clients Plain and simple, no legal jargon Customisable to suit your business Used on countless web projects since 2008

…………………………

@mjackson
mjackson / color-conversion-algorithms.js
Last active April 14, 2024 08:46
RGB, HSV, and HSL color conversion algorithms in JavaScript
/**
* Converts an RGB color value to HSL. Conversion formula
* adapted from http://en.wikipedia.org/wiki/HSL_color_space.
* Assumes r, g, and b are contained in the set [0, 255] and
* returns h, s, and l in the set [0, 1].
*
* @param Number r The red color value
* @param Number g The green color value
* @param Number b The blue color value
* @return Array The HSL representation
@olanod
olanod / templates.js
Last active April 2, 2024 05:00
Simple template loader. A global object that loads and caches templates.
const templates = Object.create(null, {
load: {
value: async function(fileName) {
const url = new URL(fileName,
document.currentScript && document.currentScript.src || location.href)
if (url in this) return this[url]
// fetch and parse template as string
let template = await fetch(url)
template = await template.text()
template = new DOMParser().parseFromString(template, 'text/html')
@stevenyap
stevenyap / Github Flavored Markdown.md
Last active March 28, 2024 17:42
Github Flavored Markdown cheatsheet

Github Flavored Markdown (GFMD) is based on Markdown Syntax Guide with some overwriting as described at Github Flavored Markdown

Text Writing

It is easy to write in GFMD. Just write simply like text and use the below simple "tagging" to mark the text and you are good to go!

To specify a paragraph, leave 2 spaces at the end of the line

Headings

@bmcbride
bmcbride / postgis_geojson.php
Created February 26, 2012 05:43
PHP PostGIS to GeoJSON
<?php
/**
* PostGIS to GeoJSON
* Query a PostGIS table or view and return the results in GeoJSON format, suitable for use in OpenLayers, Leaflet, etc.
*
* @param string $geotable The PostGIS layer name *REQUIRED*
* @param string $geomfield The PostGIS geometry field *REQUIRED*
* @param string $srid The SRID of the returned GeoJSON *OPTIONAL (If omitted, EPSG: 4326 will be used)*
* @param string $fields Fields to be returned *OPTIONAL (If omitted, all fields will be returned)* NOTE- Uppercase field names should be wrapped in double quotes
* @param string $parameters SQL WHERE clause parameters *OPTIONAL*
@take-cheeze
take-cheeze / test.cpp
Created June 21, 2014 06:49
Playing MIDI with fluidsynth on OpenAL.
#include <OpenAL/al.h>
#include <OpenAL/alc.h>
#include <boost/assert.hpp>
#include <cstdint>
#include <cstdlib>
#include <chrono>
#include <iostream>
@drawcode
drawcode / oracle_check_column_exists.sql
Last active March 23, 2023 08:18
Check if column exists on table in PGSQL
select table_name from user_tab_columns
where table_name = myTable and column_name = myColumn;