Skip to content

Instantly share code, notes, and snippets.

View alanhamlett's full-sized avatar

Alan Hamlett alanhamlett

View GitHub Profile
@Deub27
Deub27 / UIStackView+removeAll.swift
Created November 25, 2017 14:00
Remove all arranged subviews from UIStackView at once
import UIKit
extension UIStackView {
func removeAllArrangedSubviews() {
let removedSubviews = arrangedSubviews.reduce([]) { (allSubviews, subview) -> [UIView] in
self.removeArrangedSubview(subview)
return allSubviews + [subview]
}
@EQuimper
EQuimper / vscode.txt
Last active December 5, 2018 03:12
VS CODE PACKAGES
5 TOP PACKAGES
1. Path Intellisense
2. Project Manager
3. Auto Rename Tag
4. JavaScript (ES6) code snippets
5. Output Colorizer
You need to have
@rfadams
rfadams / project3.md
Created August 18, 2015 18:58
created by github.com/tr3buchet/gister

Company Trial Start / End Dates - Phase 1

We need to know if a company is in a "trial" status. There will be 2 phases to this project.

Phase 1 will construct the fields. Phase 2 will be to create the cron job that will automatically check for expired trial periods and mark the "trial_status" boolean to false.

Backend

@kdzwinel
kdzwinel / optimizely.js
Created June 17, 2015 21:31
Calculating A/B Test Sample Size
"use strict";
//based on https://www.optimizely.com/resources/sample-size-calculator/
function getSampleSize() {
let effect = 0.05; // Minimum Detectable Effect
let significance = 0.95; // Statistical Significance
let conversion = 0.05; // Baseline Conversion Rate
let c = conversion - (conversion * effect);
let p = Math.abs(conversion * effect);
@alanhamlett
alanhamlett / amqp.py
Last active October 22, 2021 21:18
send an error email when a Celery worker raises an unhandled exception
# -*- coding: utf-8 -*-
"""
wakatime.amqp
~~~~~~~~~~~~~
Setup for Celery distributed task queue.
"""
import socket
@jo
jo / js-crypto-libraries.md
Last active March 31, 2024 20:33
List of JavaScript Crypto libraries.

JavaScript Crypto Libraries

List some crypto libraries for JavaScript out there. Might be a bit out dated. Scroll to the bottom.

WebCryptoAPI

http://www.w3.org/TR/WebCryptoAPI/

This specification describes a JavaScript API for performing basic cryptographic operations in web applications, such as hashing, signature generation and verification, and encryption and decryption. Additionally, it describes an API for applications to generate and/or manage the keying material necessary to perform these operations. Uses for this API range from user or service authentication, document or code signing, and the confidentiality and integrity of communications.

@audreyfeldroy
audreyfeldroy / pypi-release-checklist.md
Last active February 23, 2023 15:03
My PyPI Release Checklist
  • Update HISTORY.md
  • Commit the changes:
git add HISTORY.md
git commit -m "Changelog for upcoming release 0.1.1."
  • Update version number (can also be minor or major)
bumpversion patch
@whitingx
whitingx / meta-tags.md
Created October 5, 2012 16:41 — forked from kevinSuttle/meta-tags.md
Complete List of HTML Meta Tags

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta charset='UTF-8'>
<meta name='keywords' content='your, tags'>
<meta name='description' content='150 words'>
<meta name='subject' content='your website's subject'>
<meta name='copyright' content='company name'>
@nikcub
nikcub / README.md
Created October 4, 2012 13:06
Facebook PHP Source Code from August 2007
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active April 19, 2024 05:15
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'