I hereby claim:
- I am dcosson on github.
- I am dcosson (https://keybase.io/dcosson) on keybase.
- I have a public key whose fingerprint is 7315 7FF6 9E72 ABBC 1CB1 0C11 5399 BD81 8F48 C11F
To claim this, I am signing this object:
#!/bin/bash | |
# | |
# Uses github's hub command line tool and r10kdiff gem to open a pull request | |
# for a repository containing a Puppetfile used by r10k. | |
# | |
# Assumes it should be from the current branch <Puppet Environment Name> in a | |
# fork to the same branch upstream (since you can't use feature branches in the | |
# same repository with r10k as it might deploy them as environments) | |
# |
I hereby claim:
To claim this, I am signing this object:
# Simple http server to test concurrency or load balancing or whatever, | |
# specifying numprocs greater than 1 will run that many instances of the | |
# flask app in subprocesses on incrementing ports beginning with the one specified | |
# Run: | |
# sudo pip install flask | |
# python hello.py [PORT-NUM] [NUMPROCS] | |
from flask import Flask | |
import os | |
import signal |
I was renaming a project from GrowthKit
to Mave
, and updating the prefix.
This got me 95% of the way there, there were a few things to clean up manually (not really sure why because the things I fixed manually matched these rules). Luckily the previous project name wasn't "View" or something that would conflict with any builtin types or setting names
rm -rf Pods
brew install rename
shopt -s globstar # requires bash 4.0+, makes ** recursive
rename s/GrowthKit/Mave/ **
MaveSDK *mave = [MaveSDK sharedInstance]; | |
[mave presentInvitePageModallyWithBlock:^(UIViewController *inviteController) { | |
if ([inviteController isKindOfClass:[UINavigationController class]]) { | |
UINavigationController *navController = (UINavigationController *)inviteController; | |
// Here replace the method "foo" with your method to present a share sheet | |
// And you can of course use a button with an image instead of the title "Share" | |
UIBarButtonItem *shareButton = [[UIBarButtonItem alloc] initWithTitle:@"Share" | |
style:UIBarButtonItemStylePlain | |
target:self action:@selector(foo)]; |
#!/usr/bin/env python | |
""" Converts all the .xml files back to .als (i.e. gzips them) | |
""" | |
import os | |
import sys | |
import subprocess | |
import gzip |
class TestHandler(WebMessageHandler): | |
""" Testing out sending data to arbitrary websockets | |
""" | |
def get(self): | |
ws_message = "I like websockets" | |
to_user_id = self.get_argument('to_user_id') | |
if not to_user_id: | |
body = "enter arg ?to_user_id=X" | |
else: | |
conn_ids = WSSession.get_active_conn_ids(to_user_id) |
# a quick shell command to kill all procs matching a grep pattern | |
for i in `ps aux | grep 'manage.py runserver' | grep -v grep | awk '{ printf "%s ", $2 }'` ; do sudo kill $i ; done |
// allows: | |
// 1235554567 | |
// (123) 555-4567 | |
// 123.555.4567 | |
// 123-555-4567 | |
/^\(?[0-9]{3}[.\-\)]?\s?[0-9]{3}[.-\s]?[0-9]{4}$/ |
# bash command to count the number of unique ip addresses in the mongrel2 access log (default format) | |
cat mongrel2.access.log | cut -f 4 -d : | cut -f 1 -d , | sort | uniq | wc -l |