Skip to content

Instantly share code, notes, and snippets.

View philfreo's full-sized avatar

Phil Freo philfreo

View GitHub Profile
@jasoncrawford
jasoncrawford / README
Created September 6, 2020 01:04
Twitter utilities
These are some Twitter utilities, written directly against their API.
Credentials are required. Sign up for a Twitter developer account.
To run these scripts, ensure the BEARER_TOKEN is in the environment. E.g., put it in a .env file and run with foreman.
@dhh
dhh / Gemfile
Created June 24, 2020 22:23
HEY's Gemfile
ruby '2.7.1'
gem 'rails', github: 'rails/rails'
gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data
# Action Text
gem 'actiontext', github: 'basecamp/actiontext', ref: 'okra'
gem 'okra', github: 'basecamp/okra'
# Drivers
@bryant988
bryant988 / zillow.js
Last active April 22, 2024 15:51
Zillow Image Downloader
/**
* NOTE: this specifically works if the house is for sale since it renders differently.
* This will download the highest resolution available per image.
*/
/**
* STEP 1: Make sure to *SCROLL* through all images so they appear on DOM.
* No need to click any images.
@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
},
@swalkinshaw
swalkinshaw / tutorial.md
Last active November 13, 2023 08:40
Designing a GraphQL API
#!/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">

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.
@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: [{
@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();
@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) {