Skip to content

Instantly share code, notes, and snippets.

View fieldform's full-sized avatar

Mark Domino fieldform

View GitHub Profile
@olehmelnyk
olehmelnyk / pantone.js
Created December 30, 2017 17:44
get HEX/RGB/CMYK by Pantone code (parse official Pantone website search result)
// get HEX/RGB/CMYK by Pantone code (parse official Pantone website search result)
async function pantone(pantoneCode){
pantoneCode = pantoneCode // validate input:
.trim()
.replace(/^PANTONE /i, '') // we don't need 'PANTONE ' here
.replace(/ /g, '-'); // no spaces
return fetch(`https://www.pantone.com/color-finder/${pantoneCode}`)
.then(response => response.text())
.then(doc => new DOMParser().parseFromString(doc, 'text/html'))

This document has moved!

It's now here, in The Programmer's Compendium. The content is the same as before, but being part of the compendium means that it's actively maintained.

@jasongilman
jasongilman / atom_clojure_setup.md
Last active May 11, 2024 02:25
This describes how I setup Atom for Clojure Development.

Atom Clojure Setup

This describes how I setup Atom for an ideal Clojure development workflow. This fixes indentation on newlines, handles parentheses, etc. The keybinding settings for enter (in keymap.cson) are important to get proper newlines with indentation at the right level. There are other helpers in init.coffee and keymap.cson that are useful for cutting, copying, pasting, deleting, and indenting Lisp expressions.

Install Atom

Download Atom

The Atom documentation is excellent. It's highly worth reading the flight manual.

@terranware
terranware / snsToSlack.js
Last active March 7, 2024 14:47
AWS Lambda function to Slack Channel hookup
var https = require('https');
var util = require('util');
exports.handler = function(event, context) {
console.log(JSON.stringify(event, null, 2));
console.log('From SNS:', event.Records[0].Sns.Message);
var postData = {
"channel": "#aws-sns",
"username": "AWS SNS via Lamda :: DevQa Cloud",
{ config, pkgs, ... }:
let
hostname = "luz3";
in {
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
# I use VirtualBox to connect to Windows and Linux guests
@kevinelliott
kevinelliott / osx-10.10-setup.md
Last active December 1, 2023 08:21
Mac OS X 10.10 Yosemite Setup

Mac OS X 10.10 Yosemite

Custom recipe to get OS X 10.10 Yosemite running from scratch, setup applications and developer environment. I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install. On average, I reinstall each computer from scratch every 6 months, and I do not perform upgrades between distros.

This keeps the system performing at top speeds, clean of trojans, spyware, and ensures that I maintain good organizational practices for my content and backups. I highly recommend this.

You are encouraged to fork this and modify it to your heart's content to match your own needs.

Install Software

@ademar
ademar / gist:a54838eded33a86b9281
Created September 24, 2014 02:09
Bitcoin block chain SQL schema
// original found : https://bitcointalk.org/index.php?topic=38246.0
CREATE TABLE blocks (
hash char(32) binary primary key,
version integer,
hashPrev char(32) binary not null,
hashMerkleRoot char(32) binary not null,
nTime integer unsigned not null,
nBits integer unsigned not null,
@staltz
staltz / introrx.md
Last active July 22, 2024 09:31
The introduction to Reactive Programming you've been missing
@gampleman
gampleman / tracking_interceptor.md
Last active June 19, 2020 21:34
Adding tracking to emails in Rails

This gist illustrates how you would add Google Analytics tracking into your Rails mailers. Add the tracking_interceptor.rb into your path and enable it for your mailers with:

register_interceptor TrackingInterceptor
@brianburridge
brianburridge / gist:11298396
Last active October 8, 2023 12:49
How to load MySQL time zone tables from Mac OS time zone files

The easiest way to load the Mysql Time Zone tables from your Mac OS time zone fields is via this command:

mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root mysql

However, on many systems like mine that will fail because some of the time zone information is incompatible with the database schema for the time zone tables.

Therefore, you'll want to load the time zone information into a text file and edit it to only include the time zones you need. (Or, attempt to find the data breaking the import.)

mysql_tzinfo_to_sql /usr/share/zoneinfo > zone_import.sql