Skip to content

Instantly share code, notes, and snippets.

View jptoto's full-sized avatar
😃

JP Toto jptoto

😃
View GitHub Profile
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.
@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>
@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
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 / gist:af50adc56e26c98be819
Created December 2, 2014 14:13
Send to Postmark w/ UTF8 Chars
import httplib
import json
postmark_token = 'API_TOKEN'
toRecip = u'''\u2122'''.encode('utf8')
url = '/email'
msg = {
'From': '"JP Toto" <jp@wildbit.com>',
@jptoto
jptoto / custom_exception.cs
Created January 27, 2015 21:16
Custom Exception w/ Log4net
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
using log4net;
namespace ConsoleApplication1
{
@jptoto
jptoto / Program.cs
Created February 2, 2015 14:08
log4net testing
class Program
{
private static readonly ILog _log = LogManager.GetLogger(typeof(Program));
static void Main(string[] args)
{
try
{
var z = decimal.Divide(10, 0);
}
catch (Exception ex)
foreach ($f in Get-ChildItem -Recurse -Path ".\" -Filter *.sln | sort-object)
{
nuget.exe restore $f.FullName -verbosity detailed
}
@jptoto
jptoto / Program.cs
Created April 18, 2015 21:59
Sending a message with Postmark Async
using System.Threading.Tasks;
using PostmarkDotNet;
namespace ConsolePostmarkLibTester
{
class Program
{
static void Main(string[] args)
{
Task.Run(async () =>
@jptoto
jptoto / Program.cs
Created April 23, 2015 16:15
Get Bounces Async
using System;
using System.Collections.Generic;
using System.Runtime.Remoting.Channels;
using System.Threading.Tasks;
using System.Xml;
using PostmarkDotNet;
namespace ConsolePostmarkLibTester
{
class Program