Skip to content

Instantly share code, notes, and snippets.

View fuel-lhartwell's full-sized avatar

Laura Hartwell fuel-lhartwell

View GitHub Profile
@catalinbostan
catalinbostan / clear-net-ports.sh
Created September 8, 2017 11:10
Clears out port collisions for VMWare guests in Vagrant env.
#!/bin/bash
##
# Show the user what we're looking to remove from the network configs.
##
printf "\nWe've located the following entries matching the associated port argument. \n"
grep "add_nat_portfwd" /Library/Preferences/VMware\ Fusion/networking | grep $1
grep $1 /Library/Preferences/VMware\ Fusion/vmnet8/nat.conf
##
@generalconsensus
generalconsensus / FeatureContext.php
Last active March 4, 2016 13:54
behat autoselect chosen.js
<?php
use Behat\Mink\Exception\ElementNotFoundException;
/**
* @Given /^I select "([^"]*)" from "([^"]*)" chosen\.js autoselect box$/
*/
public function iSelectFromChosenJAutoselectBox($option, $select) {
$select = $this->fixStepArgument($select);
$option = $this->fixStepArgument($option);
use Behat\Mink\Exception\ElementNotFoundException;
/**
* @Given /^I select "([^"]*)" from "([^"]*)" chosen\.js select box$/
*/
public function iSelectFromChosenJsSelectBox($option, $select) {
$select = $this->fixStepArgument($select);
$option = $this->fixStepArgument($option);
$page = $this->getSession()->getPage();
@jackcarter
jackcarter / slack_delete.py
Last active September 7, 2025 07:08
Delete Slack files older than 30 days. Rewrite of https://gist.github.com/jamescmartinez/909401b19c0f779fc9c1
import requests
import time
import json
token = ''
#Delete files older than this:
ts_to = int(time.time()) - 30 * 24 * 60 * 60
def list_files():
@jmauerhan
jmauerhan / wait.php
Last active August 5, 2017 21:34
Behat: Wait For AJAX Angular & jQuery
public function waitForAjax()
{
$waitTime = 10000;
try {
//Wait for Angular
$angularIsNotUndefined = $this->getSession()->evaluateScript("return (typeof angular != 'undefined')");
if ($angularIsNotUndefined) {
//If you run the below code on a page ending in #, the page reloads.
if (substr($this->getSession()->getCurrentUrl(), -1) !== '#') {
$angular = 'angular.getTestability(document.body).whenStable(function() {
@AgustinLado
AgustinLado / cowzen.py
Created June 29, 2015 15:31
Get a random line from the Zen of Python without a print (preferably for a colorful cow to chant!)
# Get a random line from the Zen of Python without a print (preferably for a colorful cow to chant!)
# Replace stdout by an anonymous class that returns nothing on write()
import sys
stdout = sys.stdout
sys.stdout = type('BlackHole', (), {'write': (lambda self, string: '')})()
# This import's output has now been supressed
import this
@eddiejaoude
eddiejaoude / README.md
Last active September 18, 2024 07:21
Install Firefox addon/extension with no user interaction

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@jbouzekri
jbouzekri / FeatureContext.php
Created February 27, 2015 18:48
A nice wait for js calls ending function in behat
<?php
/**
* @author Gildas Quéméner <gildas@akeneo.com>
* @copyright 2013 Akeneo SAS (http://www.akeneo.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
use Behat\Behat\Exception\BehaviorException;
use Behat\Mink\Driver\Selenium2Driver;
@LeCoupa
LeCoupa / bash-cheatsheet.sh
Last active March 19, 2026 23:02
Bash CheatSheet for UNIX Systems --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04