Skip to content

Instantly share code, notes, and snippets.

View BinRoot's full-sized avatar

Nishant Shukla BinRoot

View GitHub Profile
@veggiemonk
veggiemonk / install_font_scp.sh
Created July 2, 2015 13:07
install source code pro font in Ubuntu 14.04.2
#!/bin/sh
echo "installing fonts at $PWD to ~/.fonts/"
mkdir -p ~/.fonts/adobe-fonts/source-code-pro
git clone https://github.com/adobe-fonts/source-code-pro.git ~/.fonts/adobe-fonts/source-code-pro
# find ~/.fonts/ -iname '*.ttf' -exec echo \{\} \;
fc-cache -f -v ~/.fonts/adobe-fonts/source-code-pro
echo "finished installing"
@jfager
jfager / simple_server.rs
Last active December 18, 2015 09:59
Writing a websocket server in Rust, ran into an issue where the server would hang after a few connection attempts. Here's a minimal client/server; in the server, if you uncomment the separate spawned task on the default scheduler, the hang always happens. Putting that other task on its own thread makes everything work fine.
extern mod extra;
use std::{int,io,result};
use extra::{net,net_tcp,uv};
fn main() {
let (accept_port, accept_chan) = stream();
let (finish_port, finish_chan) = stream();
let addr = extra::net_ip::v4::parse_addr("127.0.0.1");
@b38tn1k
b38tn1k / tensorflowTutorialOne.py
Last active December 18, 2015 01:06
Google tensorflow tutorial 1 in a file with comments and stuff
import input_data
import tensorflow as tf
# http://www.tensorflow.org/tutorials/mnist/beginners/index.html
print '\033[93m' + 'Tutorial1 from:\nhttp://www.tensorflow.org/tutorials/mnist/beginners/index.html' + '\033[0m'
print 'MNIST INPUT DATA'
mnist = input_data.read_data_sets("MNIST_data/", one_hot=True)
'PLACE HOLDERS'
# Make a placeholder / value to input on run
@jasdev
jasdev / rtb.html
Created April 16, 2013 01:39
For future trolling
<html>
<title>rtb</title>
<head>
<meta http-equiv="refresh" content="5; url=http://twitter.com/r00tth3b0x">
</head>
<body bgcolor="black">
<pre><center><font color="white">
d8888b. .d88b. .d88b. d888888b d888888b db db d88888b d8888b. .d88b. db db
88 `8D .8P Y8. .8P Y8. `~~88~~' `~~88~~' 88 88 88' 88 `8D .8P Y8. `8b d8'
@jasdev
jasdev / gist:3205164
Created July 30, 2012 05:44
2 line wonder
private void RadiusPanel_Tap(object sender, System.Windows.Input.GestureEventArgs e)
{
settings["radius"] = ((int)settings["radius"] % 10) + 1;
radiusText.Text = (int)settings["radius"] + ((int)settings["radius"] != 1 ? " miles" : " mile");
}
@jasdev
jasdev / gist:3204954
Created July 30, 2012 05:16
Who uses Linked Lists anyways?
//Funny code segment I hacked together
private void TransportationPanel_Tap(object sender, System.Windows.Input.GestureEventArgs e)
{
settings["transportationMode"] = transportationOptions[(transportationOptions.IndexOf((string)settings["transportationMode"]) + 1) % 3];
switch ((string)settings["transportationMode"])
{
case "bike":
TransportationOption.Source = new BitmapImage(new Uri("Images/Icons/bike_icon_white.png", UriKind.Relative));
break;
case "car":
@fj
fj / gist:1065069
Last active September 26, 2015 07:58
First Wednesdays Charlottesville info