start new:
tmux
start new with session name:
tmux new -s myname
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; } |
#!/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\""}}}' |
// 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; } |
#!/bin/sh | |
# | |
# rabbitmq-server RabbitMQ broker | |
# | |
# chkconfig: - 80 05 | |
# description: Enable AMQP service provided by RabbitMQ | |
# | |
### BEGIN INIT INFO | |
# Provides: rabbitmq-server |
Open Terminal move to your home folder:
cd ~
Enable git colors:
git config --global color.ui true
Make a file called ".colors":
touch .colors
Open .colors and paste the following:
public enum Cacheability | |
{ | |
NoCache, | |
Private, | |
Public, | |
} |
public interface IEmailSender | |
{ | |
void Send(string recipient, string subject, string htmlBody); | |
} | |
public class EmailSender : IEmailSender | |
{ | |
private readonly IEmailSettings _settings; | |
public EmailSender(IEmailSettings settings) |
var owner = "scriptcs"; | |
var repo = "scriptcs"; | |
var milestone = "v0.10"; | |
var labels = new Dictionary<string, string>{ { "feature", "New" }, { "bug", "Fixed" } }; | |
var username = "adamralph"; | |
var oAuthToken = "secret"; | |
var client = Require<OctokitPack>().CreateWithOAuth("ScriptCs.ReleaseNotesScript", username, oAuthToken); | |
var issues = client.Issue.GetForRepository(owner, repo, new RepositoryIssueRequest { State = ItemState.Closed, }).Result; |
using Octokit; | |
var client = new GitHubClient(new ProductHeaderValue("scriptcs")) | |
{ | |
Credentials = new Credentials(user, password) | |
}; | |
// find all merged PRs | |
var filter = new PullRequestRequest() { State = ItemState.Closed }; | |