Skip to content

Instantly share code, notes, and snippets.

View bbqchickenrobot's full-sized avatar

Troy bbqchickenrobot

View GitHub Profile
@bbqchickenrobot
bbqchickenrobot / bst.rs
Created January 31, 2022 05:44 — forked from Wesleysaur/bst.rs
A very simple binary search tree in rust
use std::io;
#[derive(Debug)]
struct BSTNode {
value: i32,
left: Option<Box<BSTNode>>,
right: Option<Box<BSTNode>>
}
impl BSTNode {
@bbqchickenrobot
bbqchickenrobot / Nginx -> RethinkDB Admin
Last active May 3, 2016 23:57 — forked from jmdobry/Instructions.md
Nginx reverse-proxy for RethinkDB Admin UI
Start your rethinkdb instance with this flag:
`--bind all` (or `bind=all` in the configuration file for your instance)
Block external access to the web UI with these two commands:
`sudo iptables -A INPUT -i eth0 -p tcp --dport 8080 -j DROP`
`sudo iptables -I INPUT -i eth0 -s 127.0.0.1 -p tcp --dport 8080 -j ACCEPT`
Install nginx (if you haven't already):
`sudo apt-get install nginx`
@bbqchickenrobot
bbqchickenrobot / XMLSitemap.cshtml
Created April 21, 2016 19:04 — forked from alindgren/XMLSitemap.cshtml
XML sitemap for Umbraco 7 (based on Cultiv Search Engine Sitemap package). See http://www.alexlindgren.com/archive/dynamically-generated-xml-sitemaps-with-umbraco-7/
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@using System.Linq;
@{
Layout = null;
Response.ContentType = "text/xml";
}<?xml version='1.0' encoding='UTF-8' ?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemalocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
@ListChildNodes(Umbraco.TypedContent(UmbracoContext.Current.PageId).AncestorOrSelf(1))
// Runnable from Linqpad 5
// Must install the Sigil nuget package and include the Sigil namespace
void Main()
{
var createSample = GetMapperDelegate();
// try it out
createSample(23, "Hello").Dump();
}
@bbqchickenrobot
bbqchickenrobot / App.cs
Created October 11, 2015 09:54 — forked from jgold6/App.cs
Xamarin Forms Custom Map renderer to draw Polylines
using System;
using Xamarin.Forms;
using Xamarin.Forms.Maps;
namespace YourNameSpace
{
public class App : Application
{
public App()
{
using System;
using System.IO;
using System.Net;
using System.Reactive.Concurrency;
using System.Reactive.Disposables;
using System.Reactive.Linq;
namespace NodeSharp
{
class Program

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/
using System;
using System.IO;
using System.Net;
using System.Reactive.Concurrency;
using System.Reactive.Disposables;
using System.Reactive.Linq;
namespace NodeSharp
{
class Program