Skip to content

Instantly share code, notes, and snippets.

View kylefritz's full-sized avatar

Kyle Fritz kylefritz

View GitHub Profile
@kylefritz
kylefritz / notebook.py
Created November 12, 2017 03:46
Basic Plotting on jupyter notebook
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
%matplotlib inline
x = np.linspace(0, 10, 100)
y = np.cos(x)
plt.plot(x,y)
grid = np.zeros((20,20))
<?xml version="1.0"?>
<!-- Add more negative to training. -->
<opencv_storage>
<cars3 type_id="opencv-haar-classifier">
<size>
20 20</size>
<stages>
<_>
<!-- stage 0 -->
<trees>
@pratos
pratos / condaenv.txt
Created November 30, 2016 07:01
To package a conda environment (Requirement.txt and virtual environment)
# For Windows users# Note: <> denotes changes to be made
#Create a conda environment
conda create --name <environment-name> python=<version:2.7/3.5>
#To create a requirements.txt file:
conda list #Gives you list of packages used for the environment
conda list -e > requirements.txt #Save all the info about packages to your folder
#1B2B34,#4F5B66,#5FB3B3,#ffffff,#4F5B66,#FFFFFF,#5FB3B3,#EC5f67
import Cocoa
// for-in
func checkForIn(array: [Int], dict: [Int: String]) {
for num in array where dict[num] != nil {
num
}
}
checkForIn([1,2,3,4], dict: [1:"one", 2:"two"])
@natchiketa
natchiketa / a Super-simple Nginx reverse proxy with Homebrew on OS X.md
Last active May 18, 2023 04:54
Super-simple Nginx reverse proxy with Homebrew on OS X

Installation

1)

brew install nginx
sudo cp /usr/local/Cellar/nginx/1.8.0/homebrew.mxcl.nginx.plist /Library/LaunchAgents

2)

Replace /usr/local/etc/nginx/nginx.conf with the nginx.conf in this gist. I'm using port 5000 for my current project. Obviously, change server_name as well, and probably the name of its access log.

@staltz
staltz / introrx.md
Last active May 7, 2024 09:38
The introduction to Reactive Programming you've been missing
@ascheink
ascheink / gitmo-splash.rb
Last active December 13, 2015 20:08
Code to quickly create a mosaic image of the faces of the detainees still in Gitmo http://i.imgur.com/tIqdGtH.jpg
require 'nokogiri'
require 'httparty'
puts "Scraping ids of detainees in custody"
ids = []
(1..10).each do |n|
response = HTTParty.get "http://projects.nytimes.com/guantanamo/detainees/held?page=#{n}"
page = Nokogiri::HTML(response)
ids += page.css('#detaineesTable a').map { |link| $1 if /detainees\/(\d+)/ =~ link['href'] }.compact
end
@stevenharman
stevenharman / gist:2910960
Created June 11, 2012 16:16
Pivotal Tracker Activity Web Hook: event_type values
story_create
add_story_label
story_label_add
remove_story_label
story_label_remove
comment_create
comment_delete
story_move_multi
multi_story_delete
story_delete_multi
@kylefritz
kylefritz / gist:2563866
Created May 1, 2012 00:10
Delete branches that have been merged into HEAD
#all local branches that are merged into HEAD
git branch -d `git branch --merged | grep -v '^*' | tr -d '\n'`
#Delete all remote branches that are merged into HEAD
#jump back to master
git co master
#get rid of all local branches not on origin