Skip to content

Instantly share code, notes, and snippets.

View lsloan's full-sized avatar

Mr. Lance E Sloan «UMich» lsloan

  • Teaching and Learning (@tl-its-umich-edu) at University of Michigan: Information and Technology Services
  • Ann Arbor, Michigan, USA
  • 23:30 (UTC -04:00)
  • X @lsloan_umich
View GitHub Profile
@omz
omz / SlimIt-Installer.py
Created October 21, 2013 17:11
SlimIt-Installer
ply_url = 'https://pypi.python.org/packages/source/p/ply/ply-3.4.tar.gz'
slimit_url = 'https://pypi.python.org/packages/source/s/slimit/slimit-0.8.1.zip'
print 'Downloading SlimIt...'
from urllib import urlretrieve
import tarfile
import zipfile
import shutil
import os
try:
@chauncey-garrett
chauncey-garrett / test_if_interactive_shell.sh
Created October 25, 2013 20:52
Test for an interactive shell in Bash
if [[ -z $PS1 ]] # no prompt?
### if [ -v PS1 ] # On Bash 4.2+ ...
then # non-interactive
...
else # interactive
...
fi
@joyrexus
joyrexus / README.md
Last active September 29, 2025 05:43
Perl one-liners

Hi:

perl -e 'print "hello world!\n"'

A simple filter:

perl -ne 'print if /REGEX/'

Filter out blank lines (in place):

@Naatan
Naatan / executeAsPHP.js
Last active November 21, 2017 08:07
Komodo Macro - Execute file/selection as PHP
new function()
{
/**
* Execute Macro
*
* @returns {void}
*/
this.exec = function()
{
# -*- coding: utf-8 -*-
# test_docstrings.py
import pytest
def test_lambdas():
# Create a lambda and test it
doubler = lambda x: " ".join([x, x])
assert doubler("fun") == "fun fun"
# Add a docstring to the lambda
@falexandrou
falexandrou / view-pdf.js
Last active August 29, 2015 13:57
Display PDF files inline
/**
* When browser supports inline pdfs
* There is no need to append a large jquery plugin that displays them inline.
*
* You can actually use an iframe (and style it appropriately)
* or a link whenever inline PDF viewing is not supported
*
* This function is fairly simple and it's only for demo purposes
*/
function appendPdf(id, url) {
@omz
omz / Sound Demo.py
Created April 7, 2014 16:40
Sound Demo
# Simple demo of playing a looping sound using the (currently undocumented) sound.Player class
import sound
import os
from scene import *
class MyScene (Scene):
def setup(self):
self.player = sound.Player(os.path.expanduser('~/Pythonista.app/Beep.caf'))
self.player.number_of_loops = -1 #repeat forever
@lyoshenka
lyoshenka / ngrok-selfhosting-setup.md
Last active September 28, 2025 09:54
How to setup Ngrok with a self-signed SSL cert

Intro

The plan is to create a pair of executables (ngrok and ngrokd) that are connected with a self-signed SSL cert. Since the client and server executables are paired, you won't be able to use any other ngrok to connect to this ngrokd, and vice versa.

DNS

Add two DNS records: one for the base domain and one for the wildcard domain. For example, if your base domain is domain.com, you'll need a record for that and for *.domain.com.

Different Operating Systems

@morganhauck
morganhauck / 42 infographic - douglas adams
Created May 23, 2014 16:39
42 Douglas Adams Infographic
<a href="http://lemonly.com/work/42-towel-day-infographic" title="42: Life, The Universe, & Everything – A Towel Day Infographic by Lemonly">
<img src="http://lemonly.com/wp-content/uploads/2013/05/Towel_Day-42-Infographic-960x2178.jpg"style="max-width: 100%" alt="42: Life, The Universe, & Everything – A Towel Day Infographic Design by Lemonly" />
</a>
Learn more about <a href="http://lemonly.com/work/42-towel-day-infographic">Towel Day </a> and <a href="http://lemonly.com">Infographic Design</a> from Lemonly.
@morganhauck
morganhauck / Don't Panic, Use a Towel Day Infographic
Last active May 24, 2016 14:10
Don't Panic, Use a Towel Day Infographic
<a href="http://lemonly.com/work/celebrating-towel-day-may-25-2012" title="Don't Panic, Use a Towel Day Infographic">
<img src="http://lemonly.com/wp-content/uploads/2012/05/Towel-day-Infographic2.jpg"style="max-width: 100%" alt="Don't Panic Use A Towel Day Infographic Design by Lemonly" />
</a>
Learn more about <a href="http://lemonly.com/work/celebrating-towel-day-may-25-2012">Towel Day </a> and <a href="http://lemonly.com">Infographic Design</a> from Lemonly.