Skip to content

Instantly share code, notes, and snippets.

@atadams
atadams / pca-vectors.py
Last active June 21, 2024 00:59
Python scripts that compares PCA mean vectors for altered images and unaltered images from raw files
import cv2 as cv
import numpy as np
import rawpy
def perform_pca(filepath, alter_image=False):
if alter_image:
# Read the CR2 image with auto white balance or auto brightness
rgb_image = rawpy.imread(filepath).postprocess()
else:
@atadams
atadams / backmatting.ipynb
Created February 12, 2021 14:46 — forked from andreyryabtsev/backmatting.ipynb
BackMatting.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@atadams
atadams / piwik_referer_domain.sql
Created February 7, 2017 14:29
Piwik Referer Domain
SELECT
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(referer_url, '://', -1), '/', 1), 'www.', -1) AS domain,
count(*) AS visits
FROM piwik_log_visit
WHERE
visit_first_action_time BETWEEN '2017-01-01' AND '2017-02-01'
AND referer_url NOT LIKE '%effectivehealthcare.ahrq.go%'
GROUP BY domain
ORDER BY visits DESC
@atadams
atadams / _color-definitions.scss
Created February 25, 2016 14:54
Google Material Design Color Definitions in HSLA
// Color order: 50, 100, 200, 300, 400, 500, 600, 700, 800, 900, A100, A200,
// A400, A700.
// $palette-red:
$palette-red-50: hsla(351, 100%, 96%, 1);
$palette-red-100: hsla(354, 100%, 90%, 1);
$palette-red-200: hsla(0, 73%, 77%, 1);
$palette-red-300: hsla(0, 69%, 67%, 1);
$palette-red-400: hsla(1, 83%, 63%, 1);
$palette-red-500: hsla(4, 90%, 58%, 1);
@atadams
atadams / _crayon.scss
Last active August 29, 2015 14:25
Crayon (https://github.com/riccardoscalco/crayon) SCSS file with HSL colors sorted by hue, saturation, and lightness.
$black : hsl(0, 0%, 0%);
$eerieblack : hsl(0, 0%, 11%);
$granitegray : hsl(0, 0%, 40%);
$sonicsilver : hsl(0, 0%, 46%);
$quicksilver : hsl(0, 0%, 65%);
$culturedpearl : hsl(0, 0%, 96%);
$coconut : hsl(0, 0%, 100%);
$white : hsl(0, 0%, 100%);
$fuzzywuzzy : hsl(0, 50%, 60%);
$orangered : hsl(0, 100%, 58%);
// Location to your properties file
var pFile = 'location_to_your_properties_file/filename.properties';
// Init Props
var props = CreateObject("java","java.util.Properties").init();
// Load the file into the props
props.load( CreateObject("java","java.io.FileInputStream").init(pFile) );
// Assume properties file has the following value
// Property1=Foo
// Property2=Bar

Using Subsystems

Subsystems give you a way of dropping in one FW/1 application into an existing one. Subsystems can be used to create a module that has no dependencies on the parent application or you can use subsystems to group common functionality together.

Enabling Subsystems

If you want to enable subsystems, you must set the following in the parent application’s Application.cfc:

variables.framework.usingSubsystems = true;
@atadams
atadams / CSS-Only:-Hamburger-Menu-Icon.markdown
Created May 29, 2014 13:21
A Pen by Christopher Schulz.