Skip to content

Instantly share code, notes, and snippets.

@petedoyle
petedoyle / Make easier to read
Created December 30, 2010 23:57
BBB url creation
// CONFIG:
def apiBaseUrl = "http://conf.cotni.org/bigbluebutton/api" // no trailing '/' please
def salt = "26f31c52-6d4f-4562-b3c7-fd7857d191ac"
def phoneNumber = "360-536-4392" // the number to join the conference via phone
def meetingParams = [
name: 71000,
meetingID: 71000,
attendeePW: 7777,
moderatorPW: 8888,
@petedoyle
petedoyle / MainActivity.java
Created May 17, 2011 19:46
Sample android-support-v4-googlemaps MapFragment setup
public class MainActivity extends android.support.v4.app.FragmentActivity {
// Only one MapView instance is allowed per MapActivity,
// so we inflate it in the MainActivity and tie its
// lifetime here to the MainActivity. Package scope
// so we can grab them from different instances of map
// fragments.
//
// The other option was to make them static, but that causes
// memory leaks on screen rotation.
View mMapViewContainer;
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<style
name="Theme.MyTheme"
parent="android:style/Theme.Holo">
<!-- Setting windowNoTitle to true would turn off the ActionBar -->
<item name="android:windowNoTitle">false</item>
<item name="android:windowActionBar">true</item>
</style>
</resources>
@petedoyle
petedoyle / gist:2069845
Created March 18, 2012 08:08
Storm 3GB SSD - bonnie++ performance
Storm 3GB SSD instance
Filesystem: Ext3
----------------------
root@ssddb1:~# bonnie++ -d tmp -u root
...
Version 1.96 ------Sequential Output------ --Sequential Input- --Random-
Concurrency 1 -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
Machine Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP /sec %CP
ssddb1.local 5464M 1480 99 888791 77 281107 23 5919 98 608776 26 12463 111
Latency 5591us 55315us 72806us 4821us 89998us 2431us
@petedoyle
petedoyle / backup_postgres.sh
Created May 23, 2012 06:52
Postgres backup script
# Copyright 2012 Peter Doyle (petedoyle at gmail.com)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# http://localhost:8080/v1/solution?solutionCategoryId=4942
select
this_.id as id3_1_,
this_.version as version3_1_,
this_.date_created as date3_3_1_,
this_.description as descript4_3_1_,
this_.import_source as import5_3_1_,
this_.import_source_collection_url as import6_3_1_,
this_.import_source_url as import7_3_1_,
this_.keywords as keywords3_1_,
@petedoyle
petedoyle / reader_tweaks.css
Created November 2, 2011 08:24
CSS Tweaks for new Google Reader
#top-bar {
height: auto;
}
#search {
padding: 8px 0;
}
#lhn-add-subscription-section {
height: 48px;
@petedoyle
petedoyle / backup_postgres.sh
Created April 20, 2012 22:42
Backup postgres, upload to s3 using s3cmd
#!/bin/bash
if [ -z "$1" ]
then
FILENAME=pg_dumpall_$(date +"%Y%m%d-%H:%M:%S").sql.gz
else
FILENAME=$1
fi
FQ_FILENAME=/var/lib/pgsql/backups/$FILENAME
su -c "pg_dumpall | gzip -c > $FQ_FILENAME" postgres
@petedoyle
petedoyle / build_speeds_specific_changes.md
Last active July 7, 2016 19:33
Specific changes used for the build speed benchmarks

Change one line of code

For the code change tests, this is the line of code I added/removed between tests: DogMarkerOptions.java:

    public DogMarker getMarker() {
        marker.setDogId(dogId);
        marker.setPosition(position);
//        marker.setSnippet(snippet); // snippet is not overrideable in base class Marker
//        marker.setTitle(title); // title is not overrideable in base class Marker
        marker.setIcon(icon);
@petedoyle
petedoyle / gist:254f2f60c4c05334b1341379b488c757
Last active November 18, 2016 21:49
JIRA Release notes script (formatted for Slack)
var output = "\n";
$('tr.issuerow').each(function(index) {
issuerow = $(this);
var key = issuerow.find('td.issuekey a.issue-link').data().issueKey;
var summary = issuerow.find('td.summary a.issue-link').text();
var type = issuerow.find('td.issuetype img').attr('alt');
output += "* " + key + " " + summary + "\n";
});