Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:

Jennifer Konikowski jmkoni

:octocat:
View GitHub Profile
@jmkoni
jmkoni / lpthwdjango
Created Aug 18, 2013
Starting project for final LPTHW class
View lpthwdjango
1) Change into directory that you want your project in.
ex: mkdir SongIdentifier
cd SongIdentifier
2) Install and run virtualenv
pip install virtualenv
virtualenv --no-site-packages testenv
source testenv/bin/activate
3) Install required packages:
@jmkoni
jmkoni / measure.rb
Created May 26, 2015
Benchmark script from Ruby Performance Optimization (https://pragprog.com/book/adrpo/ruby-performance-optimization)
View measure.rb
require "json"
require "benchmark"
class Measure
def self.run(&block)
no_gc = (ARGV[0] == "--no-gc")
if no_gc
GC.disable
else
# collect memory allocated during library loading # and our own code before the measurement
View measurerails2.rb
require "json"
require "benchmark"
class Measure
def self.run(&block)
no_gc = (ARGV[0] == "--no-gc")
if no_gc
GC.disable
else
View pyladiessqltestdata.sql
INSERT INTO person ('id', 'first_name', 'last_name', 'email') VALUES (1, 'Rylee', 'Wynn', 'Ryl.WYN2659@yopmail.com');
INSERT INTO pet ('id', 'name', 'owner_id', 'species', 'birth_date') VALUES (1, 'Amani', 1, 'rabbit', '2013-03-30 10:00:00');
INSERT INTO pet ('id', 'name', 'owner_id', 'species', 'birth_date') VALUES (2, 'Brayan', 1, 'snake', '2003-12-03 10:00:00');
INSERT INTO address ('id', 'person_id', 'street_address', 'city', 'state', 'zip_code') VALUES (1, 1, '5836 Leroy', 'Stamford', 'CT', '06999');
INSERT INTO person ('id', 'first_name', 'last_name', 'email') VALUES (2, 'Korbin', 'Stuart', 'Kor.STUART1670@yopmail.com');
INSERT INTO pet ('id', 'name', 'owner_id', 'species', 'birth_date') VALUES (3, 'April', 2, 'cat', '2013-07-13 10:00:00');
INSERT INTO address ('id', 'person_id', 'street_address', 'city', 'state', 'zip_code') VALUES (2, 2, '5244 Summit', 'Hialeah', 'FL', '33007');
INSERT INTO person ('id', 'first_name', 'last_name', 'email') VALUES (3, 'Rebecca', 'Reilly', 'Rebecca.REILLY1364@monumentma
View how_to_turn_down_a_technical_interview.md

Hello $recruiter,

Thank you for reaching out to me about this position. While the job description sounds like something I would be a great fit for and would excel at, I realize that should I interview for this position, the skills evaluated will be my interviewing skills instead of my technical ones. For example, $company is currently found on http://they.whiteboarded.me, a curated list of tech companies known to use high-pressure interview tactics such as live-coding and whiteboarding. Not only that, setting aside the outcome, my previous interview experience at $company was not a positive one. While I admit I could have

@jmkoni
jmkoni / GIF-Screencast-OSX.md
Created Jan 24, 2018 — forked from dergachev/GIF-Screencast-OSX.md
OS X Screencast to animated GIF
View GIF-Screencast-OSX.md

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:

@jmkoni
jmkoni / Authentication.scala
Last active Jun 19, 2019
Cookie Authentication with Scalatra and JWTs
View Authentication.scala
import javax.servlet.http.{Cookie, HttpServletRequest}
import play.twirl.api.{Html, HtmlFormat}
import scala.util.{Failure, Success}
object Authentication {
def authenticateCookie(
request: HttpServletRequest): Option[UserTokenData] = {
val token =
View Authentication.scala
import javax.servlet.http.{Cookie, HttpServletRequest}
import play.twirl.api.{Html, HtmlFormat}
import scala.util.{Failure, Success}
object Authentication {
def authenticateCookie(
request: HttpServletRequest): Option[UserTokenData] = {
val token =
View Jwt.scala
import org.json4s.DefaultFormats
import org.json4s.jackson.JsonMethods.parse
import pdi.jwt.{Jwt, JwtAlgorithm}
import scala.util.Try
/*
* This object decodes JWTs that are created by another application.
* There are a few different options available for parsing JWTs and I went with:
* http://pauldijou.fr/jwt-scala/samples/jwt-core/
*/
View JwtTests.scala
import org.scalatest.{Matchers, WordSpec}
import pdi.jwt.{Jwt, JwtAlgorithm, JwtClaim}
class JwtTests extends WordSpec with Matchers {
val expirationNumber = 10
"A user data token" can {
"valid token" should {
You can’t perform that action at this time.