Skip to content

Instantly share code, notes, and snippets.

View Bowbaq's full-sized avatar

Maxime Bury Bowbaq

View GitHub Profile

Keybase proof

I hereby claim:

  • I am bowbaq on github.
  • I am bowbaq (https://keybase.io/bowbaq) on keybase.
  • I have a public key ASCctKGmlNhlIMjAg6eYIi2BTNngfVuX0CbIxxN0oAAsawo

To claim this, I am signing this object:

@Bowbaq
Bowbaq / reconnect.applescript
Last active August 29, 2015 14:16
Auto reconnect VPN
-- Instructions to compile the app
-- http://apple.stackexchange.com/questions/32392/how-to-auto-connect-to-vpn-upon-login-boot/32395#32395
on idle
-- set the name of the VPN
set vpn to "<name of the vpn>"
-- set the password
set passwd to "<your password>"
@Bowbaq
Bowbaq / cleanup_contacts.py
Last active August 29, 2015 14:11
Fetch Google Contacts, authenticate with oauth2
import argparse
from oauth2client.client import flow_from_clientsecrets
from oauth2client.file import Storage
from oauth2client import tools
from oauth2client.tools import run_flow
import gdata.contacts.data
import gdata.contacts.client
SCOPE = 'https://www.google.com/m8/feeds/'
@Bowbaq
Bowbaq / logreplay.patch
Created December 1, 2014 19:40
Use the LogReplay optimization, sort is already "$natural" by default
diff --git a/logreplayer.go b/logreplayer.go
index 4660651..817f644 100644
--- a/logreplayer.go
+++ b/logreplayer.go
@@ -76,7 +76,7 @@ func (l *logReplayer) playLog() (err error) {
// set up initial query to the oplog
logger.Info("Replaying oplog from %s to %s", l.from, l.to)
- iter := sourceOplog.Find(bson.M{"ts": bson.M{"$gt": bson.MongoTimestamp(l.from)}}).Sort("$natural").Tail(1 * time.Second)
+ iter := sourceOplog.Find(bson.M{"ts": bson.M{"$gt": bson.MongoTimestamp(l.from)}}).LogReplay().Tail(1 * time.Second)
@Bowbaq
Bowbaq / results.txt
Created October 7, 2014 16:16
Go req/s
-> % gobench -c=200 -k=true -u http://127.0.0.1:8080/ -t 10
Dispatching 200 clients
Waiting for results...
Requests: 244689 hits
Successful requests: 244689 hits
Network failed: 0 hits
Bad requests failed (!2xx): 0 hits
Successfull requests rate: 24468 hits/sec
Read throughput: 3058725 bytes/sec
diff --git a/servicetown/app/com/angieslist/presentation/core/ConfigurationController.scala b/servicetown/app/com/angieslist/presentation/core/ConfigurationController.scala
index e4cd22d..e4c0c9d 100644
--- a/servicetown/app/com/angieslist/presentation/core/ConfigurationController.scala
+++ b/servicetown/app/com/angieslist/presentation/core/ConfigurationController.scala
@@ -1,11 +1,10 @@
package com.angieslist.presentation.core
import play.api.mvc.{Controller, EssentialAction}
-import utils.{ApiResponseHelpers, SharedAuth}
+import utils.{ApiResponseHelpers, SharedAuth, ControllerUtils}
@Bowbaq
Bowbaq / Satchels.scala
Created June 21, 2013 14:52
Play 2.1 controller for integration with Satchel
package controllers
import play.api._
import play.api.mvc._
import org.ds.satchel._
object Satchels extends Controller {
def asset(file: String) = Action {