Skip to content

Instantly share code, notes, and snippets.

View jptoto's full-sized avatar
😃

JP Toto jptoto

😃
View GitHub Profile
iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))
choco install 7zip
choco install git
choco install gitextensions
choco install pidgin
choco install fiddler
choco install filezilla
choco install githubforwindows
choco install googlechrome
@jptoto
jptoto / test.php
Created September 15, 2014 19:13
Sending with Markus Hedlund php class
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
require_once 'Postmark/Autoloader.php';
\Postmark\Autoloader::register();
$postmarkApiKey = 'api_key';
$subject = 'test';
$message = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"><html xmlns=\"http://www.w3.org/1999/xhtml\"><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" /><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" /><title>VÌrktøjskasseInfo</title><style type=\"text/css\"> body {margin:0px; padding:0px; background-color:#ffffff; color:#777777; font-family:'Lucida Grande', 'Lucida Sans Unicode', Verdana, sans-serif; font-size:13px; -webkit-text-size-adjust:100%; -ms-text-size-adjust:100%; width:100% !important;} a, a:link, a:visited {color:#195d93; text-decoration:underline;} a:hover, a:active {text-decoration:none; color:#09416d !important;} h1, h2, h3, h1 a, h2 a, h3 a {color:#195d93 !important;} h2 {paddin
@jptoto
jptoto / gist:9192824
Created February 24, 2014 17:31
Get ProcessID using MSBuild
<GetServiceProcessID ServiceName="ServiceName" ContinueOnError="true">
<Output
TaskParameter="ProcessID"
PropertyName="ServiceProcessID" />
</GetServiceProcessID>
Introduction to Elasticsearch
Elasticsearch is a flexible and powerful open source, distributed, real-time search and analytics engine. Architected
from the ground up for use in distributed environments where reliability and scalability are must haves, Elasticsearch
gives you the ability to move easily beyond simple full-text search.
In this demonstration, Nick will take us through installing Elasticsearch and creating a cluster. He'll talk about
configuration and best practices and some examples of how we use Elasticsearch at Wildbit on both Postmark and
Beanstalk. JP will introduce Elasticsearch queries and talk about how information is indexed in Elasticsearch.
He'll review aggregating data and the benefits of full-text searching.
* How do I release this?
* I must be able to perform a 'rolling' release this in a live system w/o
causing a service interruption
* does it break backward compatability with existing users of the api/system/etc
* do we need to cut a new XSD? A new version (URI prefix) of our API?
* did we make updates to checkouts/SNAPSHOT deps? Do we need to cut new versions of project deps?
* how do I support existing users?
* in what order do the affected systems need to be released?
* are there system or service configuration changes that are required?
* What are the Security implications of my change?
@jptoto
jptoto / gist:7910411
Created December 11, 2013 13:27
log4net Debug
<appSettings>
<add key="log4net.Internal.Debug" value="true"/>
</appSettings>
<system.diagnostics>
<trace autoflush="true">
<listeners>
<add
name="textWriterTraceListener"
type="System.Diagnostics.TextWriterTraceListener"
initializeData="C:\temp\log4net.txt" />
@jptoto
jptoto / gist:6225332
Created August 13, 2013 20:27
Swift PHP Mailer Example
<?php
require_once 'lib/swift_required.php';
// Create the Transport
$transport = Swift_SmtpTransport::newInstance('staging-smtp.postmarkapp.com', 2525)
->setUsername('api_key')
->setPassword('api_key')
;
/*
@jptoto
jptoto / gist:5265126
Last active December 15, 2015 13:09
Postmark PHP Inbound Example
<?php
// Uses https://github.com/jjaffeux/postmark-inbound-php
require_once 'lib/Postmark/Autoloader.php';
\Postmark\Autoloader::register();
$inbound = new \Postmark\Inbound(file_get_contents('php://input'));
$filename = 'test.txt';
// ReSharper disable CheckNamespace
namespace RestSharp.Deserializers
// ReSharper restore CheckNamespace
{
public class DynamicJsonDeserializer : IDeserializer
{
public string RootElement { get; set; }
public string Namespace { get; set; }
public string DateFormat { get; set; }
@jptoto
jptoto / webapi.cs
Created February 1, 2012 12:42
WebAPI Error Catch
[WebInvoke(UriTemplate = "", Method = "POST")]
public Email Post(Email email)
{
try
{
repository.Add(email);
foreach (var file in email.Attachments)
{