Skip to content

Instantly share code, notes, and snippets.

Luke Fender lfender6445

Block or report user

Report or block lfender6445

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
lfender6445 / this.rb
Created Feb 5, 2015
util class for pulling basic project info
View this.rb
require 'pathname'
# Public: A Class containing all the metadata and utilities needed to manage a
# ruby project.
class ThisProject
# The name of this project
attr_accessor :name
# The author's name
attr_accessor :author
View gist:45abbafbbed339e82eda
class A
SOMETHING = 'hello'
class B
class A
class D
constructor: ->
new D()
lfender6445 / ruby_hash_fetch_vs_fetch_block.rb
Last active Aug 29, 2015
Ruby - Hash#fetch vs #fetch with block performance
View ruby_hash_fetch_vs_fetch_block.rb
# Benchmarks time difference between TEST_HASH.fetch(:baz, '') and TEST_HASH.fetch(:baz) { '' }
p 'Key does not exist -----'
TEST_HASH = { foo: :bar }
def operation
TEST_HASH.fetch(:baz, '')
def elaboration_time(&block)
s =
lfender6445 / gist:fa3f78f2f312fbba3bf1
Last active Dec 18, 2016
Disable Mac Built In Camera (i-Sight) - shell script
View gist:fa3f78f2f312fbba3bf1
#! /bin/bash
# ------ Description ------
# Shell script to enable and disable iSight macs built in camera
# Open terminal, follow instructions below
# ------ Installation ------
# cd ~/Downloads && curl -0 -o && chmod +x
# ------ Usage -------------
# ./
osascript <<EOF
lfender6445 / gist:47a7d6e6f0e24a67ea0e
Created Sep 28, 2014
How to SSH when default port is blocked
View gist:47a7d6e6f0e24a67ea0e
If port 22 is disabled on your network (you're getting timeouts on a public wifi network) you can force ssh connections to use https instead.
On your linux server, edit `/etc/ssh/sshd_config` and find `Port 22`. Comment it out and use port 443 instead.
# If you want to change the port on a SELinux system, you have to tell
# SELinux about this change.
# semanage port -a -t ssh_port_t -p tcp #PORTNUMBER
# Port 22
Port 443
lfender6445 / gist:70b00c97df43827279f7
Last active Sep 12, 2018
Never go idle in hipchat - Disable hipchat idle when away from computer
View gist:70b00c97df43827279f7
#! /bin/bash
# This if for the mac hipchat client
# To setup, download this file to any folder and save as ``
# change the permissions of the file so it is executable using terminal
# You can do this by running `chmod u+x ./`
# Now you can run `./`
echo 'Hipchat hooray...ho... - Press CTRL+C to stop'
while :
View gist:9c6c5d31666c46799eee
// Learn more about configuring this file at <>.
// These default settings work OK for most people. The options that *must* be changed below are the
// packages, suites, excludeInstrumentation, and (if you want functional tests) functionalSuites.
// The port on which the instrumenting proxy will listen
proxyPort: 9000,
// A fully qualified URL to the Intern proxy
proxyUrl: 'http://localhost:9000/',
lfender6445 / gist:b7949bbd127bf88e2d0c
Last active Aug 29, 2015
syslogd out of control - memory leak, osx fix
View gist:b7949bbd127bf88e2d0c

Syslogd memory leak, osx fix

syslogd out of control?

syslogd is a daemon/background process that logs and generates messages from the system. if this is eating up your CPU, you can find the offending process and kill it.

  1. Open up terminal and run tail -f /var/log/system.log. You may see some output like this, but it will be very different for you machine:

    Jun 12 11:17:08 lfender-mbp kernel[0]: *** kernel exceeded 500 log message per second limit  -  remaining messages this     second discarded ***
    Jun 12 11:17:09 lfender-mbp kernel[0]: Data/Stack execution not permitted: ruby[pid 72771] at virtual address 0x7fbd9c078000, protections were read-write
View gist:11357060
<template name='video'>
<p align="center"><input type="button" id="share_screen" value="Share screen"/></p>
<p align="center"><video id="video" autoplay='autoplay'></video></p>
<script language="javascript">
navigator.getUserMedia = navigator.webkitGetUserMedia || navigator.getUserMedia;
$('#share_screen').click(function() {
audio: false,
video: {
You can’t perform that action at this time.