Skip to content

Instantly share code, notes, and snippets.

View philfreo's full-sized avatar

Phil Freo philfreo

View GitHub Profile
@philfreo
philfreo / README.md
Last active August 8, 2016 02:29
SSL CSR & localhost self-signing

Generate a CSR for production use:

openssl req -nodes -newkey rsa:2048 -sha256 -keyout mysite-ssl.private-key.pem -out mysite-ssl.csr -subj '/C=US/ST=California/L=Palo Alto/O=My Company Inc./CN=*.example.com'

Generate a long-lasting self-signed cert & trust it for localhost development usage:

openssl req -nodes -newkey rsa:2048 -sha256 -x509 -days 3650 -keyout selfsigned.key -out selfsigned.crt -subj '/C=US/ST=Anywhere/L=Anywhere/O=Localhost/CN=local.example.com'
@tbveralrud
tbveralrud / submodule-update-fix-snippet.yml
Created January 21, 2016 00:20
(Temporary) Fix for submodule update error on CircleCI
# CircleCI failed to build a git submodule update step.
# Tracked it down to partially complete .git/modules existing in our source cache.
# This removes the .git/modules directory before the submodule update.
# The error:
# $ git submodule update --init
# git submodule update --init returned exit code 128
# fatal: Not a git repository: ../.git/modules/<project> Action failed: git submodule update --init
checkout:
@leonardofed
leonardofed / README.md
Last active October 2, 2026 09:04
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.


@wojcikstefan
wojcikstefan / remove_live_calls_from_plivo_debug_logs.js
Last active January 13, 2017 16:01
Remove live call requests from Plivo's call debug logs
// Remove calls to /v1/Account/AUTH_ID/Call/?status=live from Plivo's call debug logs
// To use this code as a bookmarklet, create a bookmark with a URL equal to:
// javascript:(function(){if(typeof window.cleanPlivoDebugLogsGist !== 'undefined'){cleanPlivoDebugLogs();}else{s=document.createElement('script');s.type='text/javascript';s.src='https://rawgit.com/wojcikstefan/97517db33265b2c2f362bd0c0cd577ae/raw/b7112b1e39e9b011dd6cf0a9f631cf6b50e6624e/remove_live_calls_from_plivo_debug_logs.js';document.body.appendChild(s);}})();
window.cleanPlivoDebugLogs = function() {
$('.log-loader li').each(function(i, el) {
$(el).find('b').each(function(j, headerEl) {
var $headerEl = $(headerEl);
if ($headerEl.text().indexOf('Params') === 0) {
@superstrong
superstrong / google-script-asana-api.js
Created November 19, 2016 02:10
Retrieve JSON data from the Asana API and add it to a Google Sheet. This example retrieves all the users in a workspace. Stands on the shoulders of https://gist.github.com/varun-raj/5350595a730a62ca1954
function getAsanaUsers() {
var options = {
"headers" : {
"Authorization": "Bearer <TOKEN>"
}
}
var response = UrlFetchApp.fetch("https://app.asana.com/api/1.0/workspaces/<workspace-id>/users", options);
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheets = ss.getSheets();
@nabilfreeman
nabilfreeman / lambda-redirect-to-trailing-slash.js
Last active March 7, 2023 20:31
Redirect to trailing slashes on CloudFront with AWS Lambda. (all this because S3 uses 302 redirects instead of 301)
'use strict';
const path = require('path')
const redirect = new_url => {
return {
status: '301',
statusDescription: 'Moved Permanently',
headers: {
location: [{

Background

For the purposes of this assignment, the application I'm imagining is a financial / accounting solution for startup and small business CFOs. The purpose of the application would be comparing a previously set budget (maybe at a management or board-level) with what is actually being spent day-to-day and cataloged based on account type, department, etc.

Given that accounts can be divided by department, members of each department are required to login and post their expenses on a bi-weekly or monthly basis, so that their budgets can be tracked appropriately. In order to do so, I'm assuming that data can be imported by:

  • Quickbooks account
  • Expensify (or something similar)
  • Exported (CSV) credit card transactions.
  • Manually-added expenses from personal cards, etc.
  • Manually manipulating inputted data to reflect changes.
#!/bin/bash
set -e
CONTENTS=$(tesseract -c language_model_penalty_non_dict_word=0.8 --tessdata-dir /usr/local/share/tessdata/ "$1" stdout -l eng | xml esc)
hex=$((cat <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
@swalkinshaw
swalkinshaw / tutorial.md
Last active January 5, 2026 14:33
Designing a GraphQL API
@craigmdennis
craigmdennis / svgo.json
Last active May 16, 2023 16:46
SVGo Sketch Plugin Configuration
{
"comment": "This is the settings file for the SVGO Compressor Plugin. For more info, please check <https://github.com/BohemianCoding/svgo-compressor>",
"pretty": true,
"indent": 2,
"floatPrecision": 3,
"plugins": [
{
"name": "removeDoctype",
"enabled": true
},