Skip to content

Instantly share code, notes, and snippets.

View macfire's full-sized avatar

MediaFuse macfire

View GitHub Profile
@macfire
macfire / cursor.css
Created June 23, 2021 18:28 — forked from dsdsdsdsdsds/cursor.css
CSS: Cross Browser hires/retina cursor image
.cursor {
cursor: url("cursor.png") 0 0, pointer; /* Legacy */
cursor: url("cursor.svg") 0 0, pointer; /* FF */
cursor: -webkit-image-set(url("cursor.png") 1x, url("[email protected]") 2x) 0 0, pointer; /* Webkit */
}
@macfire
macfire / jq-cheetsheet.md
Created June 21, 2021 22:17 — forked from olih/jq-cheetsheet.md
jq Cheet Sheet

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq

@macfire
macfire / countries.md
Created September 29, 2020 16:18 — forked from richjenks/countries.md
ISO 3166 countries by region — AMER, EMEA & APAC
Country ISO 3166 Region
Afghanistan AF EMEA
Åland Islands AX EMEA
Albania AL EMEA
Algeria DZ EMEA
American Samoa AS APAC
Andorra AD EMEA
Angola AO EMEA
Anguilla AI AMER
@macfire
macfire / install-mongodb-mac-os-x.md
Created July 21, 2020 22:03 — forked from Sydney-o9/install-mongodb-mac-os-x.md
Install MongoDB on Mac OS X without brew

1. Download latest source

# Get latest from MongoDB website
$ curl -O https://fastdl.mongodb.org/osx/mongodb-osx-x86_64-3.4.6.tgz
$ tar -zxvf mongodb-osx-x86_64-3.4.6.tgz
$ mkdir -p mongodb
$ cp -R -n mongodb-osx-x86_64-3.4.6/ mongodb
$ sudo mv mongodb /usr/local
@macfire
macfire / nginx.conf
Created December 11, 2019 00:12 — forked from Stanback/nginx.conf
Example Nginx configuration for adding cross-origin resource sharing (CORS) support to reverse proxied APIs
#
# CORS header support
#
# One way to use this is by placing it into a file called "cors_support"
# under your Nginx configuration directory and placing the following
# statement inside your **location** block(s):
#
# include cors_support;
#
# As of Nginx 1.7.5, add_header supports an "always" parameter which
var defaults = {
number: 1,
bool: true,
magic: 'real',
animal: 'whale',
croutons: 'delicious'
};
var options = {
number: 2,
@macfire
macfire / flask_gridfs_images.py
Created April 6, 2019 23:29 — forked from cuppster/flask_gridfs_images.py
Recipe for downloading images into a mongoDB gridfs collection, then serving the images with a Flask application. No temp files created.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
SYNOPSIS
flask_gridfs_images.py --start
flask_gridfs_images.py --add <IMAGE_URL>
DESCRIPTION
@macfire
macfire / codekit_hook_timestamp.txt
Last active August 3, 2018 21:49
Codekit hook: timestamp
//Shell script in 'Hooks' settings panel
// Prepends timestamp to specified files
TIME=$(date +"%a %d %b %Y %H:%M:%S")
lf=$'\n';
sed "1s;^;/* $TIME */\\$lf;" $CK_INPUT_PATH > $CK_OUTPUT_PATH
@macfire
macfire / javascript_console_helpers.js
Created November 9, 2017 14:41
Javascript console helpers
/**
* Short version to window.console.log()
*/
var LOG = LOG || console.log.bind(console);
/**
* Display function caller
* Put at beginning of a function to determine who called the function
*/
// Display function name only
@macfire
macfire / fontawesome_list.py
Created November 8, 2017 14:52
FontAwesome choices in Select2 drop down field
# Using tuples to trigger Select2 in flask-admin.
# Adjust as needed
FONTAWESOME = (
("","---"),
("fa-500px", "fa-500px"),
("fa-address-book", "fa-address-book"),
("fa-address-book-o", "fa-address-book-o"),
("fa-address-card", "fa-address-card"),
("fa-address-card-o", "fa-address-card-o"),