Skip to content

Instantly share code, notes, and snippets.

View phoikoi's full-sized avatar

Peter Hull phoikoi

View GitHub Profile
@phoikoi
phoikoi / # gnu-cobol - 2015-12-30_15-41-44.txt
Created December 30, 2015 23:42
gnu-cobol on OS X 10.11.2 - Homebrew build logs
Homebrew build logs for gnu-cobol on OS X 10.11.2
Build date: 2015-12-30 15:41:44
<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">%h</name>
<service>
<type>_smb._tcp</type>
<port>445</port>
</service>
au FileType xml setlocal equalprg=xmllint\ --format\ --recover\ -\ 2>/dev/null
@phoikoi
phoikoi / pytut2.py
Last active August 29, 2015 14:03
pytut2
import sys
def a_function(multiply): # multiply should be True or False
if multiply: # the caller has asked for a multiplier function
def another_func(x): # define a new multiplier function (object)
return x*x
else: # the caller has asked for a non-multiplier function
def another_func(x): # define a new multiplier function (object)
return x+x
another_func.cheese = "yummy" # Functions are real objects, so they can have arbitrary properties
@phoikoi
phoikoi / README.md
Last active August 29, 2015 14:01 — forked from vanto/README.md

FlickrImg Liquid Tag for Jekyll

This is a single-purpose fork of vanto's simple liquid tag that helps to easily embed images, videos or slides from OEmbed enabled providers, which in turn uses Magnus Holm's great oembed gem which connects to the OEmbed endpoint of the link's provider and retrieves the HTML code to embed the content properly (i.e. an Image tag for Flickr) This fork allows only Flickr embeds, from one particular album (since that's the way I work my blog) but allows a much simpler tag, not requiring you to type out the whole URL every time.

How to install

  1. Make sure you have the ruby-oembed gem (Rubygems, Github) installed.
  2. Copy flickrimg.rb to <your-jekyll-project>/_plugins
  3. Add a "flickrimg" config entry to your _config.yml, with an 'album' subentry which contains the bit of the flickr URL that identifies your album. In other words, if you have a Flickr URL such as `
#!/bin/sh
# on ubuntu: need some utils & dev libs
sudo apt-get install apache2-utils openssl libssl-dev libpcre3-dev
# compile nginx
cd /tmp
curl http://nginx.org/download/nginx-0.7.64.tar.gz | tar xz
cd nginx*
./configure --with-http_ssl_module --with-http_dav_module \

Server Install

Ubuntu

sudo apt-get update
sudo apt-get install -y xfce-session tightvncserver

Client Install

Mac (Comes with OS X)

@phoikoi
phoikoi / gist:9356353
Last active August 29, 2015 13:57
Shell script for modifying python virtualenv scripts after moving them to new location
# When using virtualenvwrapper to manage your python virtual environments,
# if you need to move your virtualenvs to a new location, mostly all that is
# necessary is to modify your shell initialization scripts (~/.bash_profile, etc.)
# But there's a problem waiting to bite you: each virtualenv's activate script has
# the path to the virtualenv hard-coded into it by mkvirtualenv. So you need
# to edit each one to change this. Otherwise things will not work after moving
# things to the new location. This gist is a sample of how to change all the
# virtualenvs at once with a little shell script and sed. Run this script
# after you've changed the variables in your bash_profile and restarted your
# shell.