Skip to content

Instantly share code, notes, and snippets.

#!bin/bash
brew install go
mkdir -p ~/Developer/go
export GOPATH=$HOME/Developer/go
go get golang.org/x/tour/gotour
cd $GOPATH
./bin/gotour
import React, { Component } from 'react';
import ReactTable from 'react-table'
import './App.css';
import 'react-table/react-table.css'
const data = [{
name: 'Tanner Linsley',
age: 26,
friend: {

Keybase proof

I hereby claim:

  • I am agamdua on github.
  • I am agam (https://keybase.io/agam) on keybase.
  • I have a public key whose fingerprint is ED78 BADD 92A7 6C2C 3852 B768 E802 EA65 764C E9CF

To claim this, I am signing this object:

@agamdua
agamdua / install-tmux
Last active November 19, 2015 01:56 — forked from rothgar/install-tmux
Install tmux 1.9 on rhel/centos 6
# Install tmux on Centos release 6.5
# install deps
yum install gcc kernel-devel make ncurses-devel
# DOWNLOAD SOURCES FOR LIBEVENT AND MAKE AND INSTALL
curl -OL https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz
tar -xvzf libevent-2.0.21-stable.tar.gz
cd libevent-2.0.21-stable
./configure --prefix=/usr/local
"""
This finds the duplicates in the matrix (list of lists) and returns
a list of all items "visited" and a list of all "duplicate".
This has been run like:
% python matrix.py
These items have been visited at least once: [[1, 2, 3], [3, 4, 5]]
These are the duplicates: [[1, 2, 3]]
"""
use std::sync::{Mutex, Arc};
use std::thread;
struct Philosopher {
name: String,
left: usize,
right: usize,
}
@agamdua
agamdua / compile_string.py
Created May 1, 2014 13:39
From django.templates.base
def compile_string(template_string, origin):
"Compiles template_string into NodeList ready for rendering"
if settings.TEMPLATE_DEBUG:
from django.template.debug import DebugLexer, DebugParser
lexer_class, parser_class = DebugLexer, DebugParser
else:
lexer_class, parser_class = Lexer, Parser
lexer = lexer_class(template_string, origin)
parser = parser_class(lexer.tokenize())
return parser.parse()
@agamdua
agamdua / template-base.py
Created May 1, 2014 13:36
Template class from base.py in Django
class Template(object):
def __init__(self, template_string, origin=None, name=None):
try:
template_string = force_text(template_string)
except UnicodeDecodeError:
raise TemplateEncodingError("Templates can only be constructed "
"from unicode or UTF-8 strings.")
if settings.TEMPLATE_DEBUG and origin is None:
origin = StringOrigin(template_string)
self.nodelist = compile_string(template_string, origin)
@agamdua
agamdua / fabfile.py
Created March 12, 2014 17:14 — forked from kecs/fabfile.py
from fabric.api import env, local, run, require, cd, sudo
import os
from fabric.context_managers import cd
env.project_name = 'weight'
def prod():
"Use the actual webserver"
@agamdua
agamdua / ngRepeat-example.html
Last active August 29, 2015 13:56
Simple example illustrating basic usage of the ngRepeat directive (AngularJS)
<div ng-controller="ExampleCtrl1">
<div ng-repeat="book in books">
{{ $index+1 }} {{ book }}
</div>
</div>