Skip to content

Instantly share code, notes, and snippets.

View danman01's full-sized avatar

Danny Kirschner danman01

View GitHub Profile
@danman01
danman01 / install chromedriver on ubuntu
Last active August 6, 2020 16:50
install chromedriver on ubuntu
# Note: make sure you get the correct chromedriver link for your version of chrome, and that it's a stable release. Check here: https://sites.google.com/a/chromium.org/chromedriver/downloads
# steps:
# get the file
# unzip it
# move it to /usr/local/bin (or wherever)
# I already added the above to my path. If you haven't, edit your ~/.bashrc or terminal profile of choice, and add `export PATH=/usr/local/bin:$PATH`
# change owner to root
# add executable
# check version...
# done!
.some-static-class:before {
content: "";
display: block;
position: absolute;
top: -30px;
right: -30px;
bottom: -30px;
left: -30px;
animation: some-static-class .2s infinite;
animation-name: some-static-class;
@danman01
danman01 / flash.js
Created August 7, 2019 16:23
flash and hide jquery addition
// Extend jquery with flashing for elements
$.fn.flash = function(duration, iterations, hideAfter) {
duration = duration || 1000; // Default to 1 second
iterations = iterations || 1; // Default to 1 iteration
const iterationDuration = Math.floor(duration / iterations);
for (let i = 0; i < iterations; i++) {
this.fadeOut(iterationDuration).fadeIn(iterationDuration);
}
@danman01
danman01 / index.html
Created April 16, 2019 16:06
example html
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<h1>This is a Heading</h1>
-- return all public tables
SELECT * FROM information_schema.tables WHERE table_schema = 'public'
@danman01
danman01 / ruby_on_rails_mojave_upgrade_nokogiri_c_compliler_install.md
Last active February 8, 2019 14:40
Ruby on Rails install after Mojave upgrade - getting Nokogiri and C compiler working

I had to run the following cryptic commands to get my C compiler working in mac osx Mojave, after having everything working fine in a previous OS (Yosemite I think it was...)

This is an (somewhat) obvious step when upgrading osx:

xcode-select --install

I also had to do this, which I never would've known how to do without google and this post

sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /
@danman01
danman01 / vim notes
Created January 25, 2019 19:15
vim notes
vim
Vim is a text editor available on most unix systems, and can easily be installed via package managers if not installed.
Great for working in the terminal.
Learning curve, but improves speed overtime.
Terminal based text editor is the tool of choice for most professional coders (vim or emacs).
My reasoning: why work with Atom, when you can work with Vim? Vim will always be there, always improving. Available on all systems, to all devs around the world (ssh into a server, use vim)

SQL Notes

In this workshop, we will be learning and using SQL to access data in a relational database

Objectives:

  • Explain what a database is
  • Compare and contrast relational db vs NoSQL db
  • Write SQL commands to get data out of a database
  • Write SQL to put data into a database
@danman01
danman01 / ripped_books_v1.js
Last active February 8, 2018 21:55
ripped books: find min/max pages that an array of ripped pages could represent.
Sure, there's a way to use reduce and do this all in one line. This v2 is 477 bytes as is.
test data:
const sample_input = [[7,8,100,101,222,223],
[ 2,3,88,89,90,103,177 ],
[ 2,3,6,7,10,11 ],
[ 1 ],
[ 1,2 ]]
const sample_output = [ "4/5","5/6","3/6","1/1","1/2" ]
@danman01
danman01 / binary_search.rb
Created December 21, 2017 19:20
binary_search_ruby
#!/usr/bin/env ruby
# Usage: ruby binary_search.rb [debug] 50 0 100
# Returns: [optional: count of tries] @item, when found within first and last (not inlusive)
module Algorithms
class BinarySearch
def initialize
@n = 0