Skip to content

Instantly share code, notes, and snippets.

@benoror
benoror / airtable-proxy.js
Last active April 19, 2020 10:51
Node.js Airtable API Proxy
var express = require('express');
var proxy = require('http-proxy-middleware');
var options = {
logLevel: 'debug',
target: 'https://api.airtable.com/v0/' + process.env.APP_ID,
changeOrigin: true,
headers: {
'Accept': 'application/json',
'Authorization': 'Bearer ' + process.env.API_KEY
},
@ejdyksen
ejdyksen / patch-edid.md
Last active April 6, 2024 15:59
A script to fix EDID problems on external monitors in macOS

patch-edid.rb

A script to fix EDID problems on external monitors in macOS.

Instructions

  1. Connect only the problem display.

  2. Create this directory structure (if it doesn't already exist):

@jlyon
jlyon / AWS_Getting_Started.md
Last active December 28, 2015 01:19
Getting started with AWS: Auto-assigning an IP on boot, etc

Install ec2 tools

Set JAVA_HOME
  • See if JAVA_HOME is set: $JAVA_HOME
  • Find Java path (see AWS docs)
echo 'export JAVA_HOME="/usr/lib/jvm/java-6-openjdk-amd64/jre"' >> ~/.bashrc
# May also be: echo 'export JAVA_HOME="/usr/lib/jvm/java-7-oracle"' >> ~/.bashrc
# verify Java path
@jlyon
jlyon / Vufind Getting Started.md
Last active December 24, 2015 01:29
Getting started with Vufind 2.1 and demo MARC records on Ubuntu 13.04

Getting started with Vufind

Installing

See http://vufind.org/wiki/vufind2:installation_ubuntu. We're just doing the fastest installation with the .deb package. Make sure that your security group (if using AWS) is set to allow ports 80 and 8080.

Install Vufind and Dependencies

Create an Ubuntu 13.04 instance in Amazon AWS and login as root (sudo su).

# Dependencies
@jlyon
jlyon / OTP Transit System Map.md
Last active December 23, 2015 12:19
OTP Transit System Map. Following along https://github.com/openplans/OpenTripPlanner/wiki/GettingStartedSystemMap. Tested in Ubuntu 12.04 LTS

Transit System Map from GTFS data

###Dependencies

Add export JAVA_HOME=/usr/lib/jvm/java-7-oracle to ~/.bashrc

# Install tomcat
sudo apt-get install tomcat7
# It may be necessary to edit nano /etc/default/tomcat7 if you are 
# getting JAVA_HOME errors.  Uncomment the JAVA_HOME line
@juampynr
juampynr / mymodule.info
Last active June 9, 2023 21:53
Drupal 7 Views 3 custom field handler
dependencies[] = ctools
; Views Handlers
files[] = views/mymodule_handler_handlername.inc
@bhays
bhays / Quantity Discounts
Last active December 5, 2020 21:38
Auto discount prices based on quantities in Gravity Forms. Uses a percentage based approach.
(function($){
$.fn.quantityDiscounts = function(options) {
// set up default options
var defaults = {
discountColor: '#FF0000',
discounts: [
{ limit: 174, discount: .75, text: "25% Discount Applied"},
{ limit: 139, discount: .80, text: "20% Discount Applied"},
@jlyon
jlyon / basic_commands.sh
Last active December 17, 2015 18:19
ubuntu basic command line(sed, scp, df, rsync, users)
# create a user with a home dir, add to group
useradd -m -d/home/if.jeff -Gwww-data -s/bin/bash if.jeff
# tar
tar cvzf foo.tgz foo
tar xvzf foo.tgz
# zip
zip foo.zip foo
unzip foo.gz
@jlyon
jlyon / tar_zip_gzip.sh
Created May 26, 2013 10:07
tar, zip, gzip basic linux commands
# tar
tar cvzf foo.tgz foo
tar xvzf foo.tgz
# zip
zip foo.zip foo
unzip foo.gz
# gz
gunzip foo.gz
@mrconnerton
mrconnerton / gist:1979037
Last active December 4, 2018 15:13
node form in ctools modal drupal 7
<?php
/*
Make Sure you include:
ctools_include('modal');
ctools_modal_add_js();
On the pages you put your link.
*/