Skip to content

Instantly share code, notes, and snippets.

@logie17
logie17 / gist:5352170
Created April 10, 2013 06:03
Weather Proxy via Python
#! /usr/bin/env python
import urllib, cgi, random, string
cgi_params = cgi.FieldStorage()
lat = cgi_params.getvalue('lat') or '42.3265152'
lon = cgi_params.getvalue('lon') or '-122.87559490000001'
unit = cgi_params.getvalue('unit') or 0
lg = cgi_params.getvalue('lg') or 'english'
@belden just learned that tie is literally Magic. Perl API ftw
@logie17
logie17 / 520 Spec
Created July 18, 2014 12:24
520 Spec
%filter_from_provides /.*/d
%filter_from_requires /^perl.*/d
%filter_setup
%global runtime perl520
%global perl520_rootdir /opt/rock/runtime/%{runtime}
%global privlib %{perl520_rootdir}%{_prefix}/share/perl5
%global archlib %{perl520_rootdir}%{_prefix}/lib/perl5
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAwdwbChV5rzyvarkmQEynFj/YNWrC/S0e5M8gM20ZM49ZTv9ysIDf7feF3I+/B2F626hPQykHHYaa7MTtA3RiVq4EfkGRc5vV/hjjePzaETZy09ZOdJj2ZUUyhPkfdf1LrLkeGaytkT5OaRxS92fWj09riFQwCtlX/ksbQiW5sy+cJNP81z3PZqO2yhUs22gHs+Ck7jJpb0V6VLwekFs/GnbXWm6Y/Oq4aEgXo8mNeMxKw2LzBATiz3owUmMFiMAUNVBDKAcfQctSYSX3y/QLeIYJ0Vsz7YyY+Jmmg3CDQYaP/CgbySkVc1n7avEwIJ0grZB/gv7i6/nsqoaQlQdt/Q== [email protected]
(ns markov-elear.core)
package main
import (
"fmt"
"unicode/utf8"
)
func main() {
str := "\u0928" + "\u093F"
fmt.Println(len(str))
var logLines []string
type logMock struct{}
func (l *logMock) Write(p []byte) (int, error) {
logLines = append(logLines, string(p))
return 0, nil
}
//CaptureLogOutput A utility to capture the log output of a function and pass it along

2/10/2016

Today I learned about a vim plugin called "ctrlp". This plugin can be found here..o The interesting thing about this plugin is that it adds fuzzy searching to vim.

Installed it the following ways:

cd ~/.vim
git clone https://github.com/kien/ctrlp.vim.git bundle/ctrlp.vim

2/11/2016

JWT and key signing with RSA

#!/usr/bin/env bash
set -e
#git rev-list --no-merges "${1:-HEAD}" | \
# while read rev; do
# if [ $(git show -s --format='%b' $rev | wc -w) -gt 300 ]; then
# echo "$(git show -s --format='%b' $rev | wc -w) words: $rev"
# fi