Skip to content

Instantly share code, notes, and snippets.

View bigethan's full-sized avatar

Big Ethan bigethan

View GitHub Profile
@bigethan
bigethan / query_test.php
Created October 25, 2011 18:16
MySQL Racing PHP against Python with Gevent and SQLAlchemy
<?php
//read in file
$queries = file('homepage_queries.txt');
$conns = array();
$connList = '';
$queryCount = 0;
//start timer
$start = microtime(true);
@bigethan
bigethan / gist:1754014
Created February 6, 2012 18:46
Use Neo4jPHP with Symfony2

Grab the Everyman folder from https://github.com/jadell/neo4jphp/tree/master/lib and put it into vendor/neo4j/lib

In /app/autoload.php in the $loader->registerNamespaces method, add :

'Everyman'           => __DIR__.'/../vendor/neo4j/lib',

to the array argument.

Then you can call the Everyman/Neo4j classes with:

@bigethan
bigethan / gist:36162a39ebb00c959691
Created July 14, 2015 22:04
Add Pagespeed module to installed Nginx
#get pagespeed code
cd
NPS_VERSION=1.9.32.4
wget https://github.com/pagespeed/ngx_pagespeed/archive/release-${NPS_VERSION}-beta.zip
unzip release-${NPS_VERSION}-beta.zip
cd ngx_pagespeed-release-1.9.32.4-beta/
wget https://dl.google.com/dl/page-speed/psol/${NPS_VERSION}.tar.gz
tar -xzvf ${NPS_VERSION}.tar.gz
#get nginx code
@bigethan
bigethan / proxyquire-nock-api-test.js
Created December 13, 2015 09:01
Nock and Proxyquire to easily mock code that makes API calls when testing
var nock = require('nock')
var proxyquire = require('proxyquire')
// get a refrence to the code that defines the external api call
var generateConfigForApiCall = require('../../../lib/api-config')
// data for testing
var mockData = require('../../mock-data')()
// require with proxyquire, and override the module that builds the api config

Keybase proof

I hereby claim:

  • I am bigethan on github.
  • I am bigethan (https://keybase.io/bigethan) on keybase.
  • I have a public key ASAqVWOoR_bWqwST_WZfNPp9fvi2dX4dw8jckpkJTyDJzAo

To claim this, I am signing this object:

@bigethan
bigethan / docs_red_when_unshared.user.js
Last active October 11, 2020 18:01
Makes the Google docs share button red when only the author has access. To install click the `Raw` button and your userscript extension will take it from there.
// ==UserScript==
// @name Red Share button when only I can see the file
// @namespace http://bigethan.com/
// @version 0.1
// @description To prevent sharing unshared docs, this turns the share button on google docs red when it's only shared with me.
// @author Bigethan
// @match https://docs.google.com/document/*
// @grant none
// ==/UserScript==
(function(document) {
@bigethan
bigethan / sidekiq_busy_jobs_enhancement.user.js
Last active October 11, 2020 18:01
Adds table filtering to the sidekiq busy jobs list and toggles the visibility of the processes table. To install click the `Raw` button and your userscript extension will take it from there.
// ==UserScript==
// @name Sidekiq BusyJob Helper
// @namespace http://bigethan.com/
// @version 0.1
// @description On Sidekiq's UI fro busy jobs: Toggles the workers table and adds a way to filter the busy jobs table
// @author bigethan
// @match https://*/sidekiq/busy
// @grant none
// ==/UserScript==
@bigethan
bigethan / fresh_linkedin_feed.user.js
Last active October 11, 2020 18:00
Hides posts in your linked feed that are Promoted or more than 1 week old. To install click the `Raw` button and your userscript extension will take it from there.
// ==UserScript==
// @name Fresh Linkedin Feed
// @namespace http://bigethan.com/
// @version 0.1
// @description Hide promoted and weeks old content in the linkedin feed
// @author @bigethan
// @match https://www.linkedin.com/feed/
// @grant none
// ==/UserScript==
@bigethan
bigethan / rails_autoscale_refresh.user.js
Last active October 11, 2020 17:59
The rails autoscale charts are great, but also you have to refresh them a lot, so this makes the refresh if you've been away for more than 30s. To install click the `Raw` button and your suserscript extension will take it from there.
// ==UserScript==
// @name Refresh Autoscaler Charts
// @namespace http://bigethan.com/
// @version 0.1
// @description Reload the Rails Autoscaler UI when coming back to it after 30s
// @author bigethan
// @match https://app.railsautoscale.com/*/dashboard/web
// @match https://app.railsautoscale.com/*/dashboard/critical_worker
// @match https://app.railsautoscale.com/*/dashboard/default_worker
// @match https://app.railsautoscale.com/*/dashboard/slow_worker
@bigethan
bigethan / clubhouse_new_story_link_copier.user.js
Created October 13, 2020 00:09
Copies the link to stories as they are created in clubhouse. Not recommended if you don't use a clipboard history tool. To install click the `Raw` button and your userscript extension will take it from there.
// ==UserScript==
// @name Copy New Story Link
// @namespace http://bigethan.com/
// @version 0.1
// @description Adds the link to a created story to the clipboard (don't use without a clipboard history tool)
// @author @bigethan
// @match https://app.clubhouse.io/*
// @grant none
// ==/UserScript==