Skip to content

Instantly share code, notes, and snippets.

View rsalmond's full-sized avatar
🤔
but how does computer!?

rob salmond rsalmond

🤔
but how does computer!?
View GitHub Profile
; Configuration file for AppNeta TraceView PHP instrumentation via the
; `oboe.so` extension. For help configuring the extension, please visit:
; https://support.tv.appneta.com/solution/categories/89581/folders/146755/articles/142080-configuring-php-instrumentation
extension=oboe.so
[oboe]
; oboe.tracing: When traces should be initiated for incoming requests. Valid
; options change behavior when the incoming request is already part of a trace:
; "always" - Continue existing traces, otherwise attempt to start a new one.
@rsalmond
rsalmond / gist:33250f274a7ff4d78651
Created December 12, 2014 08:22
async angular google maps loader
<html>
<head>
<meta charset='utf-8'>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.3.5/angular.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/lodash.js/2.4.1/lodash.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/angular-google-maps/2.0.11/angular-google-maps.js"></script>
<title>async angular maps</title>
<style type="text/css">
.angular-google-map-container {
position: absolute;
{
"log": {
"version": "1.2",
"creator": {
"name": "WebInspector",
"version": "537.36"
},
"pages": [],
"entries": [
{
@rsalmond
rsalmond / gist:8e9442de0b7055c090aa
Created June 18, 2014 17:50
Tracing a few queries in PHP.
<?php
try {
$pdo = new PDO('sqlite::memory:');
} catch(PDOException $e) {
echo $e->getMessage();
}
oboe_log_entry('my_layer');
@rsalmond
rsalmond / gist:a3dbf2961bc934a0c445
Created May 28, 2014 23:49
Protocol Relative version of the Navlet bookmarklet code https://code.google.com/p/navlet/
javascript:(function () { window.navlet = { url_root: "//navlet.googlecode.com/git/", dev_url_root: "//localhost/navlet/" }; var loader = document.createElement("div"); loader.setAttribute("id", "navlet-loader"); loader.setAttribute("style", "z-index: 10000;position:fixed;top:0;left:0;background-color:black;color:white;font-weight:bold;font-size: 16px;lime-height:1em;padding:15px 40px;"); document.getElementsByTagName('body')[0].appendChild(loader); loader.innerHTML = "Loading Navlet ..."; var navletPath = "//navlet.googlecode.com/git/"; var bootstrapNode = document.createElement("script"); bootstrapNode.src= window.navlet.url_root + "navlet.js"; document.getElementsByTagName('head')[0].appendChild(bootstrapNode); })()
@rsalmond
rsalmond / gist:10312091
Created April 9, 2014 20:36
PowerShell Test for Traceview Connectivity
function Test-Port{
<#
.SYNOPSIS
Tests port on computer.
.DESCRIPTION
Tests port on computer.
.PARAMETER computer
Name of server to test the port connection on.
@rsalmond
rsalmond / gist:6611297
Created September 18, 2013 15:55
Manually starting a new trace, profiling a function, and continuing a trace down into instrumented library calls with TraceView
import oboe
import urllib2
from oboeware import loader
# load monkey-patched instrumentation for supported modules
loader.load_inst_modules()
oboe.config['tracing_mode'] = 'always'
oboe.config['sample_rate'] = 1
@rsalmond
rsalmond / gist:5736708
Created June 8, 2013 21:38
Create a ticket with a file attachment through the Freshdesk API
require "rubygems"
require "rest_client"
require "json"
site = RestClient::Resource.new("http://yourcompany.domain.com/helpdesk/tickets.json","sample@freshdesk.com","test")
#custom ticket fields should be added as <ticket_field_name>_<account_id>
data={:description=>"Test ticket creation with attachments",:subject=>"new ticket sample",:email=>"test@abc.com",:custom_field=>{:department_category_16699=>"Information Technology"},"attachments"=>{''=>[{:resource=>File.open("tommy1.jpg")},{:resource=>File.open("tommy.jpg")}]}}
response = site.post({:helpdesk_ticket=> data},:content_type=>"application/json")
@rsalmond
rsalmond / gist:5726554
Created June 7, 2013 01:48
Posting dicts along side a file with Requests seems to break when dict is nested. (Note "form:" section in output).
#!/usr/bin/python
import requests
import json
api = 'api_key'
url_test = 'http://httpbin.org/post'
files = {'file' : open('big_smile.png','rb')}
new_ticket = {'helpdesk_ticket' : {'description' : 'status = 2', \