Skip to content

Instantly share code, notes, and snippets.

View jptoto's full-sized avatar
😃

JP Toto jptoto

😃
View GitHub Profile
@NoobsArePeople2
NoobsArePeople2 / gist:4490307
Last active August 15, 2018 20:10
Configuration for .bash_profile on OSX to get some Posh-Git features.
  1. Open Terminal move to your home folder: cd ~

  2. Enable git colors: git config --global color.ui true

  3. Make a file called ".colors": touch .colors

  4. Open .colors and paste the following:

@krmcbride
krmcbride / rabbitmq-server
Created December 5, 2012 21:55
RabbitMQ 3.0 Server init.d script
#!/bin/sh
#
# rabbitmq-server RabbitMQ broker
#
# chkconfig: - 80 05
# description: Enable AMQP service provided by RabbitMQ
#
### BEGIN INIT INFO
# Provides: rabbitmq-server
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 31, 2024 22:29
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@rdingwall
rdingwall / DynamicJsonDeserializer.cs
Created February 22, 2012 12:22
RestSharp deserialize JSON to dynamic
// 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; }
@lukas-vlcek
lukas-vlcek / gist:1680067
Created January 26, 2012 00:45
Phrase search (out of the box 0.18.7)
#!/bin/sh
curl -X DELETE 'localhost:9200/i/t'
curl -X PUT 'localhost:9200/i/t/1' -d '{"f":"Lorem ipsum Robert E. Anderson dolor sit amet."}'
curl -X PUT 'localhost:9200/i/t/2' -d '{"f":"Lorem ipsum Robert Johnson."}'
curl -X POST 'localhost:9200/_refresh'
echo "\n\nSearch for \"Robert Johnson\"\n"
curl -X GET 'localhost:9200/_search?pretty=true' -d '{"fields":["f"],"query":{"query_string":{"query":"\"Robert Johnson\""}}}'
echo "\n\nSearch for \"Robert E. Anderson\"\n"
curl -X GET 'localhost:9200/_search?pretty=true' -d '{"fields":["f"],"query":{"query_string":{"query":"\"Robert E. Anderson\""}}}'
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Principal;
namespace My.Infrastructure.Security
{
public class MyPrincipal: IPrincipal
{
public string Name { get; set; }