Skip to content

Instantly share code, notes, and snippets.

View joeybeninghove's full-sized avatar

Joey Beninghove joeybeninghove

View GitHub Profile
let element = document.querySelector('#auto-complete');
let uri = 'https://example.org/search';
let choice = new Choices(element, {
removeItemButton: false,
itemSelectText: '',
shouldSort: false,
});
let timer = null;
choice.passedElement.addEventListener('search', function (event) {
@kevinelliott
kevinelliott / 1-macOS-10.12-sierra-setup.md
Last active February 5, 2024 07:22
macOS 10.12 Sierra Setup

macOS 10.12 Sierra Setup

Custom recipe to get macOS 10.12 Sierra running from scratch, setup applications and developer environment. This is very similar (and currently mostly the same) as my 10.11 El Capitan setup recipe and 10.10 Yosemite setup recipe. I am currently tweaking this for 10.12 Sierra and expect to refine this gist over the next few weeks.

I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install. I generally reinstall each computer from scratch every 6 months, and I do not perform upgrades between releases.

This keeps the system performing at top speeds, clean of trojans, spyware, and ensures that I maintain good organizational practices for my content and backups. I highly recommend this.

You are encouraged to fork this and modify it to your heart's content to match your o

@arteezy
arteezy / puma.service
Last active April 23, 2024 00:31
Manage Puma with systemd and rbenv
[Unit]
Description=Puma Rails Server
After=network.target
[Service]
Type=simple
User=deploy
WorkingDirectory=/home/deploy/app/current
ExecStart=/home/deploy/.rbenv/bin/rbenv exec bundle exec puma -C /home/deploy/app/shared/config/puma.rb
ExecStop=/home/deploy/.rbenv/bin/rbenv exec bundle exec pumactl -S /home/deploy/app/shared/tmp/pids/puma.state stop
@julienbourdeau
julienbourdeau / prestashop.conf
Created May 4, 2016 14:23
PrestaShop Nginx Configuration
server {
listen 80;
listen [::]:80; #Use this to enable IPv6
server_name www.example.com;
root /var/www/prestashop17;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
index index.php index.html;
@migrs
migrs / Kernel.php
Last active April 9, 2017 20:46
newrelic patch for laravel5.2
<?php namespace App\Http;
use Illuminate\Foundation\Http\Kernel as HttpKernel;
class Kernel extends HttpKernel
{
protected $middleware = [
\App\Http\Middleware\NewRelicPatch::class,
//... your other middlewares
];
@grenade
grenade / 01-generate-ed25519-ssh-key.sh
Last active May 2, 2024 23:15
generate ed25519 ssh and gpg/pgp keys and set file permissions for ssh keys and config
#!/bin/bash
# generate new personal ed25519 ssh key
ssh-keygen -o -a 100 -t ed25519 -f ~/.ssh/id_ed25519 -C "rob thijssen <rthijssen@gmail.com>"
# generate new host cert authority (host_ca) ed25519 ssh key
# used for signing host keys and creating host certs
ssh-keygen -t ed25519 -f manta_host_ca -C manta.network
eval "$(ssh-agent -s)"
@studiopress
studiopress / columns.css
Last active August 10, 2023 13:50
Genesis column classes.
/* Column Classes
Link: http://twitter.github.io/bootstrap/assets/css/bootstrap-responsive.css
--------------------------------------------- */
.five-sixths,
.four-sixths,
.one-fourth,
.one-half,
.one-sixth,
.one-third,
@arnab
arnab / controller.rb
Last active April 6, 2021 15:02
Allow & test CORS requests in Rails
before_filter: allow_cors_requests
def allow_cors
headers["Access-Control-Allow-Origin"] = "*"
headers["Access-Control-Allow-Methods"] = %w{GET POST PUT DELETE}.join(",")
headers["Access-Control-Allow-Headers"] = %w{Origin Accept Content-Type X-Requested-With X-CSRF-Token}.join(",")
head(:ok) if request.request_method == "OPTIONS"
# or, render text: ''
# if that's more your style
end
<div class="question type_text">
<label for=""></label>
<div class="input">
<input type="text" name="" id="" class="question-text" value="" />
<span class="help-block">More help block if needed</span>
</div>
</div>
<div class="question type_radio">
<label for="optionsRadios" class="desc"></label>

Ruby Debugger

Most of the time simple output statements using warn, raise, or a logger will help you find your issue. But sometimes you need the big guns, and that means ruby-debug.

Ruby-Debug

The ruby-debug package has had some rocky times during the transition from Ruby 1.8.7 to 1.9.2 and beyond. But now, finally, the debugger is reliable and usable.

Installation