Skip to content

Instantly share code, notes, and snippets.

View richfergus's full-sized avatar
🇺🇸
merica

Rich richfergus

🇺🇸
merica
View GitHub Profile
[
{
"grade": "O10",
"0": "",
"2": "",
"3": "",
"4": "",
"6": "",
"8": "",
"10": "",
@ansaso
ansaso / google_calendar_color_map.md
Last active April 29, 2024 14:59
google calendar color mapping. name (string) to id (integer).

intro

As of 2020-07-27 The default google calendar api response does not include the user visible names:

google calendar color choice.

Below is a json map for all the default colors. Please note:

  • colorId empty for event with default color
  • different colorId for the same color in Calendar and Event (ex. Tomato: 11 and 3)
  • there is no consistent logic in the enumeration of the colors
<!DOCTYPE html>
<html ng-app="risevision.apps" itemscope itemtype="http://schema.org/WebApplication" prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb#">
<head lang="en">
<base href="/">
<meta name="fragment" content="!">
<meta charset="UTF-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="icon" href="https://s3.amazonaws.com/Rise-Images/favicons/rv_favicon.ico" type="image/x-icon">
@bembengarifin
bembengarifin / upsert_table.sql
Last active April 24, 2020 08:01
mysql bulk insert, with duplicate key update (upsert), and with conditional data update
/*
references:
- https://dev.mysql.com/doc/refman/5.7/en/insert-on-duplicate.html
- https://stackoverflow.com/questions/32777081/bulk-insert-and-update-in-mysql
- https://thewebfellas.com/blog/conditional-duplicate-key-updates-with-mysql
*/
/* create a new database and use it */
drop database if exists test_upsert;
create database test_upsert;
<cfcomponent output="false" displayname="Spreadsheet Service">
<cffunction name="init" access="public" output="false" returntype="SpreadsheetService">
<cfreturn this />
</cffunction>
<cffunction name="createFromQuery" access="public" output="false" returntype="void">
<cfargument name="data" type="query" required="true" />
<cfargument name="xlsx" type="boolean" required="false" default="false" hint="File extension is xlsx (true) or xls (false)." />
<cfargument name="fileName" type="string" required="false" default="" hint="Final file name sent to the browser." />
<cfset var config = {
@richfergus
richfergus / USMilitaryPay_2017.json
Last active April 2, 2017 22:49
DFAS Pay Tables for 2017
[
{
"grade": "O10",
"0": "0",
"2": "0",
"3": "0",
"4": "0",
"6": "0",
"8": "0",
"10": "0",
[
{
"grade":"O10",
"0":"0",
"2":"0",
"3":"0",
"4":"0",
"6":"0",
"8":"0",
"10":"0",
@taoyuan
taoyuan / npm-using-https-for-git.sh
Last active May 9, 2025 20:39
Force git to use https:// instead of git://
# npm using https for git
git config --global url."https://github.com/".insteadOf [email protected]:
git config --global url."https://".insteadOf git://
# npm using git for https
git config --global url."[email protected]:".insteadOf https://github.com/
git config --global url."git://".insteadOf https://
@kalebdf
kalebdf / LICENSE
Last active January 30, 2024 11:17 — forked from adilapapaya/README
Export Table Data to CSV using Javascript
MIT License
Copyright (c) 2015 Kaleb Fulgham
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, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@calebgrove
calebgrove / stateToAbbr.js
Last active April 24, 2024 22:18
Convert state name to abbreviation in JavaScript. There's some better solutions in the comments, so scroll down!
// There's some better solutions in the comments, so scroll down and see how other folks have improved this!
// USAGE:
// abbrState('ny', 'name');
// --> 'New York'
// abbrState('New York', 'abbr');
// --> 'NY'
function abbrState(input, to){