Skip to content

Instantly share code, notes, and snippets.

View jamesmichiemo's full-sized avatar
☯️
casting lots

Mana jamesmichiemo

☯️
casting lots
  • University of North Carolina
View GitHub Profile
@bmaupin
bmaupin / install-oracle-client-ubuntu.md
Last active February 2, 2024 04:38
Install Oracle client on Ubuntu

Reference: https://help.ubuntu.com/community/Oracle%20Instant%20Client

Tested on: Ubuntu 18.04, 20.04

  1. Decide which version of the Oracle client to install

  2. Download the Oracle client packages

@kimadactyl
kimadactyl / README.sh
Last active August 29, 2022 20:47
Dokku / Digital Ocean / Rails / Postgres / Let's Encrypt / persistent storage
# Creating a Digital Ocean droplet running Rails + Postgres with persistant storage and https
#--------------------------------------------------------------------------------------------
# For your ctrl-D pleasure...
# SERVER_IP
# APP_NAME
# RAILS_SECRET (generate with `rails secret`)
# ADMIN_EMAIL
@MJeorrett
MJeorrett / rails_react_heroku_quickstart.md
Last active June 22, 2023 13:56
How to get a React Client with Rails api running on Heroku

Rails React Heroku Quickstart

A quickstart guide for getting a React.js client running with a Rails API, both hosted on Heroku. Topics Covered:

  • Creating a Rails API and deploying to Heroku
  • Creating a React app using create-react-app and deploying to Heroku
  • Configuring React app to speak to local host / Heroku instance of API automatically

Prerequisits

This is a very quick run down so it is assumed that you have a basic understanding of Unix, Node, NPM, Rails and React. It is also assumed that you have Ruby, Node and NPM installed already.

Quick Note on the Tools Used

@mikbe
mikbe / nokogiri_sucks.txt
Last active July 10, 2016 04:07
How to install Nokogiri
## Do this before doing bundle install
# Make sure you have Xcode installed with command line utilities.
# Install Home Brew (if you already have it installed update it):
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew update --system
brew update
@robertsdionne
robertsdionne / deepdream-install.md
Last active February 15, 2021 16:07
Deepdream installation
#!/usr/bin/env bash

# Assuming OS X Yosemite 10.10.4

# Install XCode and command line tools
# See https://itunes.apple.com/us/app/xcode/id497799835?mt=12#
# See https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/xcode-select.1.html
xcode-select --install
@bnnadi
bnnadi / scrape
Last active August 29, 2015 14:19
Basic Python Single Page Web Scraper
from bs4 import BeautifulSoup
from urllib2 import urlopen
from time import sleep # be nice
import json
# insert any website you want
BASE_URL = "http://plasticscolor.com"
def make_soup(url):
html = urlopen(url).read()
return BeautifulSoup(html, "lxml")
@robertcedwards
robertcedwards / gist:fcec06dc0904a438c6a8
Created November 3, 2014 21:35
onmouseover html5 video play, mouseout pause
<html>
<head>
</head>
<body>
<div style="text-align:center" onmouseover="Play()" onmouseout="Pause()">
<video id="video1" width="480">
<source src="http://clips.vorwaerts-gmbh.de/VfE_html5.mp4" type="video/mp4" />
<source src="http://clips.vorwaerts-gmbh.de/VfE_html5.ogg" type="video/ogg" />
Your browser does not support HTML5 video.
</video>
@KdotJPG
KdotJPG / OpenSimplex2S.java
Last active April 29, 2024 17:30
Visually isotropic coherent noise algorithm based on alternate constructions of the A* lattice.
/**
* K.jpg's OpenSimplex 2, smooth variant ("SuperSimplex")
*
* More language ports, as well as legacy 2014 OpenSimplex, can be found here:
* https://github.com/KdotJPG/OpenSimplex2
*/
public class OpenSimplex2S {
private static final long PRIME_X = 0x5205402B9270C86FL;
@SteveBenner
SteveBenner / macfix1-install-nokogiri.rb
Last active August 13, 2019 14:52
Mac fix - Install Nokogiri gem on OS X 10.9 Mavericks
#!/usr/bin/env ruby
#
# Mac fix 1 - Install the Nokogiri gem on Mac OS 10.9 Mavericks
#
# Usage: to configure and install using Bundler, pass in 'bundle' as an argument to the script.
#
# Nokogiri works at a very low level, so it has many issues on various platforms.
# As a result, the command `install gem nokogiri` often will fail. This fix is for
# errors involving 'libiconv', such as the following one I encountered:
#
@youngbrioche
youngbrioche / images_helper.rb
Last active February 8, 2024 08:15
Responsive images helper using srcset in Rails
module ImagesHelper
# Acts as a thin wrapper for image_tag and generates an srcset attribute for regular image tags
# for usage with responsive images polyfills like picturefill.js, supports asset pipeline path helpers.
#
# image_set_tag 'pic_1980.jpg', { 'pic_640.jpg' => '640w', 'pic_1024.jpg' => '1024w', 'pic_1980.jpg' => '1980w' }, sizes: '100vw', class: 'my-image'
#
# => <img src="/assets/ants_1980.jpg" srcset="/assets/pic_640.jpg 640w, /assets/pic_1024.jpg 1024w, /assets/pic_1980.jpg 1980w" sizes="100vw" class="my-image">
#
def image_set_tag(source, srcset = {}, options = {})
srcset = srcset.map { |src, size| "#{path_to_image(src)} #{size}" }.join(', ')