Skip to content

Instantly share code, notes, and snippets.

View sampsonbryce's full-sized avatar

Bryce Sampson sampsonbryce

View GitHub Profile
@sampsonbryce
sampsonbryce / color-range-generator.py
Created November 1, 2021 11:26
A python script to generate a range of colors based on a single color by adjusting the brightness and darkness of the color
#!/usr/bin/env python3
import sys
import argparse
def hex_to_rgb(hex_color):
if len(hex_color) != 7:
raise Exception("Passed %s into hex_to_rgb(), needs to be in #87c95f format." % hex_color)
rgb_hex = [hex_color[x:x+2] for x in [1, 3, 5]]
rgb = [int(hex_value, 16) for hex_value in rgb_hex]
@sampsonbryce
sampsonbryce / README.md
Last active August 22, 2023 14:14
Heroku Sentry Release Script

Heroku Sentry Release

Trigger a release in sentry from heroku. A workaround for getsentry/sentry#15722

Note:

  1. The script is setup for a RAILS project, you may need to change how the script finds the sentry environment
  2. The script is setup for if you use commit hashes as the release versions in sentry. It does not use the heroku release version.
@sampsonbryce
sampsonbryce / gist:f6e2a8ba2836ac58e4aa9b0ff3d83d68
Created April 8, 2017 18:50
Function to scrape html of content from page to make searchable pdfs
function getHtml(){ var w = window.open(); $(w.document.body).append('<input type="textarea" />').text($('section[role="main"]').find('iframe').contents().find('html').html());
}
@sampsonbryce
sampsonbryce / gist:af4d864545bd0226ac8924494fa0384b
Created January 27, 2017 18:17
vimrc for numbers and space tabs
set nu
set tabstop=8 softtabstop=0 expandtab shiftwidth=4 smarttab
(function(e,f){var b={},g=function(a){b[a]&&(f.clearInterval(b[a]),b[a]=null)};e.fn.waitUntilExists=function(a,h,j){var c=this.selector,d=e(c),k=d.not(function(){return e(this).data("waitUntilExists.found")});"remove"===a?g(c):(k.each(a).data("waitUntilExists.found",!0),h&&d.length?g(c):j||(b[c]=f.setInterval(function(){d.waitUntilExists(a,h,!0)},500)));return d}})(jQuery,window);
// attach quicktree to jquery
(function($) {
$.fn.quicktree = function() {
function click(e) {
var a = $(this);
a.next('ul').children("li").toggle();
a.parent().parent().parent().find('.active').removeClass('active');
a.addClass('active');
e.preventDefault();
}
@sampsonbryce
sampsonbryce / datasift_ajax.handlebars
Created July 29, 2016 01:30
An ajax to access DataSift API
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Example App</title>
</head>
<body>
@sampsonbryce
sampsonbryce / webpack.config.js
Created June 17, 2016 21:35
react webpack.config.js
module.exports = {
entry: __dirname + "/src/js/container.jsx",
devtool: 'source-map',
output: {
path: __dirname + "/dist",
filename: "bundle.js"
},
module: {
loaders: [{
test: /\.jsx$/,
@sampsonbryce
sampsonbryce / package.json
Created June 17, 2016 21:34
jsx react package.json
{
"name": "react-without-jsx",
"version": "1.0.0",
"description": "",
"main": "index.js",
"dependencies": {},
"devDependencies": {
"babel-cli": "^6.4.0",
"babel-core": "^6.4.0",
"babel-loader": "^6.2.1",
@sampsonbryce
sampsonbryce / center-in-page.css
Created June 17, 2016 03:55
Center container on page
.vertical-center {
min-height: 100%; /* Fallback for browsers do NOT support vh unit */
min-height: 100vh; /* These two lines are counted as one :-) */
display: flex;
align-items: center;
}