Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
######################################################################
##
## [Camera Broadcaster Script]
##
## Can achive 200ms delay when playing from Flash via RTMP
##
######################################################################
function docker-ips() {
(
echo 'CONTAINER ID|NAME|IP|PORTS';
docker ps --quiet "$@" | xargs --no-run-if-empty docker inspect --format='{{printf "%.12s" .Id}}|{{.Name}}|{{range $net, $conf := .Netw
orkSettings.Networks}}{{$net}}:{{$conf.IPAddress}} {{end}}|{{.NetworkSettings.Ports}}'
) | column -t -s '|'
}
package main
import "fmt"
type MessageBuilder interface {
WithOwner(string) MessageBuilder
WithWebinar(string) MessageBuilder
WithViewer(string, string) MessageBuilder
Build() *Message
}
@rmueller
rmueller / switch-local-git-repo-to-fork.md
Created December 29, 2017 10:46 — forked from jpierson/switch-local-git-repo-to-fork.md
How to move to a fork after cloning

If you are like me you find yourself cloning a repo, making some proposed changes and then deciding to later contributing back using the GitHub Flow convention. Below is a set of instructions I've developed for myself on how to deal with this scenario and an explanation of why it matters based on jagregory's gist.

To follow GitHub flow you should really have created a fork initially as a public representation of the forked repository and the clone that instead. My understanding is that the typical setup would have your local repository pointing to your fork as origin and the original forked repository as upstream so that you can use these keywords in other git commands.

  1. Clone some repo (you've probably already done this step)

    git clone git@github...some-repo.git
@rmueller
rmueller / .bashrc
Created December 27, 2017 17:44
PS1 com git no .bashrc
PS1='\[\033[0;32m\]\[\033[0m\033[0;32m\]\u\[\033[0;36m\] @ \w\[\033[0;32m\] - [$(git branch 2>/dev/null | grep "^*" | colrm 1 2)\[\033[0;32m\]]\[\033[0m\033[0;32m\] \$\[\033[0m\033[0;32m\]\[\033[0m\] '
<?xml version="1.0" encoding="utf-8"?>
<AdminDeploymentCustomizations xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.microsoft.com/wix/2011/AdminDeployment">
<BundleCustomizations TargetDir="C:\Program Files (x86)\Microsoft Visual Studio 14.0" NoCacheOnlyMode="default" NoWeb="default" NoRefresh="default" SuppressRefreshPrompt="default" Feed="default" />
<SelectableItemCustomizations>
<SelectableItemCustomization Id="VSUV3RTMV1" Hidden="no" Selected="yes" FriendlyName="Visual Studio 2015 Update 3" />
<SelectableItemCustomization Id="MicroUpdateV3.1" Selected="yes" FriendlyName="Update for Microsoft Visual Studio 2015 (KB3165756)" />
<SelectableItemCustomization Id="NativeLanguageSupport_VCV1" Hidden="no" Selected="no" FriendlyName="Common Tools for Visual C++ 2015" />
<SelectableItemCustomization Id="Win81SDK_HiddenV1" Hidden="no" Selected="no" FriendlyName="Windows 8.1 SDK and Universal CRT SDK" />
<SelectableIte
Disable-UAC
choco feature enable -n=allowGlobalConfirmation
cinst 7zip.install
cinst ConEmu
cinst slack
cinst sublimetext3
cinst beyondcompare
cinst putty
cinst sysinternals
@rmueller
rmueller / statsd_graphite_ubuntu14.sh
Last active November 2, 2015 20:53 — forked from rposbo/statsd_graphite_ubuntu14.sh
A single script to setup StatsD and Graphite on Ubuntu 15.10 on Azure
#!/bin/bash
# First I usually add a new disk and mount it on /opt, to make sure I dont run out of space on / on azure ubuntu linux
# https://azure.microsoft.com/en-us/documentation/articles/virtual-machines-linux-how-to-attach-disk/
echo "#### Starting"
echo "#### apt-get updating and installing"
sudo apt-get update
sudo apt-get install screen libexpat1-dev libicu-dev git build-essential curl software-properties-common python-software-properties -y
public class WebApiClient
{
private HttpWebRequest httpWebRequest;
public WebApiClient(Uri uri, int timeOut)
{
httpWebRequest = CreateHttpWebRequest(uri, timeOut);
}
public string Post(string conteudo)
class Program
{
static void Main(string[] args)
{
System.Net.ServicePointManager.DefaultConnectionLimit = Int32.MaxValue;
string baseAddress = "http://localhost:3333/";
// Start OWIN host
using (WebApp.Start<Startup>(url: baseAddress))