Skip to content

Instantly share code, notes, and snippets.

View bhoung's full-sized avatar

Brendan Houng bhoung

View GitHub Profile
Example: https://denpa.moe/~syrup/himawari8.png
@DmitrySoshnikov
DmitrySoshnikov / GIF-Screencast-OSX.md
Created January 30, 2020 07:37 — forked from dergachev/GIF-Screencast-OSX.md
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@mkowoods
mkowoods / tmp.sql
Created July 9, 2019 11:27
Notes for Will Buy on Return visit
Source Data Set: https://console.cloud.google.com/bigquery?p=data-to-insights&d=ecommerce&t=web_analytics&page=table
## TRAIN
CREATE OR REPLACE MODEL `ecommerce.classification_model_2`
OPTIONS
(model_type='logistic_reg', labels = ['will_buy_on_return_visit']) AS
WITH all_visitor_stats AS (
@rduplain
rduplain / app.py
Created January 19, 2012 17:28
Plot a PNG using matplotlib in a web request, using Flask.
"Plot a PNG using matplotlib in a web request, using Flask."
# Install dependencies, preferably in a virtualenv:
#
# pip install flask matplotlib
#
# Run the development server:
#
# python app.py
#
@CMCDragonkai
CMCDragonkai / creating_a_new_stack_project_in_haskell.md
Last active September 14, 2021 11:49
Creating a new Stack Project in a Nix Shell #haskell

Creating a new Stack Project in a Nix Shell

There are so many different ways of building and maintaining Haskell projects.

I'm going to talk about using nix-shell and stack.

First you want a ~/.stack/config.yaml:

 local-bin-path: /home/USERNAME/.stack/bin
@dkav6
dkav6 / Transform.py
Last active September 21, 2021 12:26
from chalice import Chalice
import boto3
from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer
import pandas as pd
from datetime import datetime
app = Chalice(app_name='Lambda2')
"""On SNS message from Lambda1, tranform data by dropping duplicates
and get sentiment"""
@dtheodor
dtheodor / listen_pg.py
Created December 18, 2014 21:30
Listen for pg_notify with Psycopg2
import select
import datetime
import psycopg2
import psycopg2.extensions
conn = psycopg2.connect(database="postgres", user="vagrant")
#conn.set_isolation_level(psycopg2.extensions.ISOLATION_LEVEL_AUTOCOMMIT)
curs = conn.cursor()
@andrevdm
andrevdm / amazonka_eg.hs
Created September 23, 2017 13:10
Amazonka: example dynamo & s3
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Protolude hiding (to, (&))
import qualified System.IO as IO
import Control.Lens ((<&>), (^.), (.~), (&), set, view)
import qualified Data.Text as Txt
import qualified Data.Conduit as C
@seanhess
seanhess / Test.hs
Created July 8, 2015 18:27
Haskell Servant ReaderT ExceptT newtype monad transformer stack
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Serials.Route.Test where
import Control.Monad.Trans (lift)
import Control.Monad.Trans.Either
@michaelwebb76
michaelwebb76 / Technical Test Instructions.md
Last active February 23, 2023 23:23
Technical Test Instructions

WELCOME

We're stoked you've chosen to join us. If you're successful, you'll be joining a team that is focused on technical excellence and continuous improvement. We take great care to produce well-structured, well-tested, maintainable code. To be successful, you'll need to demonstrate that you do as well.

Our expectations are that this exercise should take you no longer than 4 hours to complete (and hopefully much less). If it takes you much longer than that to get to a working solution, you might not be the right candidate for this role.

INSTRUCTIONS

  1. Complete the short version of the Big 5 test and save your results as text.
  2. Create a new git repository for your code.
  3. Write a utility that parses the textual results of your test into the following format. Note that you'll need to include your email, which doesn't appear in the output of your Big 5 test. Feel free to use intermediary data structures and useful libraries.