Skip to content

Instantly share code, notes, and snippets.

View copyninja's full-sized avatar

Vasudev Kamath copyninja

View GitHub Profile
# Copyright (c) 2010, Philip Plante of EndlessPaths.com
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
AlertDialog.Builder builder;
AlertDialog alertDialog;
Context mContext = getApplicationContext();
LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(LAYOUT_INFLATER_SERVICE);
View layout = inflater.inflate(R.layout.custom_dialog,
(ViewGroup) findViewById(R.id.layout_root));
TextView text = (TextView) layout.findViewById(R.id.text);
text.setText("커스텀 다이얼로그...");
@fcalderan
fcalderan / inception-javascript.js
Created November 2, 2010 09:42
inception explained as a 4 nested javascript closures
/*
* Fabrizio Calderan, twitter @fcalderan, 2010.11.02
* I had an idea: could Inception movie be explained by a few javascript closures
* and variable resolution scope (just for fun)?
*
* Activate javascript console =)
*/
<script>
console.group("inception movie");
@santhoshtr
santhoshtr / syllabify-with-index.py
Created May 1, 2011 10:41
syllabify with word and syllable index
#!/usr/bin/python
# -*- coding: utf-8 -*-
texts =[u"वाराणसी", u"भौगोलिक", u"उपदर्शन"]
signs = [
u'\u0902', u'\u0903', u'\u093e', u'\u093f', u'\u0940', u'\u0941',
u'\u0942', u'\u0943', u'\u0944', u'\u0946', u'\u0947', u'\u0948',
u'\u094a', u'\u094b', u'\u094c', u'\u094d']
limiters = ['.','\"','\'','`','!',';',',','?']
virama = u'\u094d'
@chrisyco
chrisyco / power.sh
Created May 24, 2011 03:38
Suspend, hibernate, restart or shutdown the computer without sudo!
#!/bin/sh
# Suspend, hibernate, restart or shutdown the computer without sudo!
# by Chris Wong
# Released to the public domain.
NAME=$0
usage() {
echo "Usage: $NAME suspend|hibernate|restart|shutdown"
@akumria
akumria / find-forks.py
Last active March 9, 2024 01:39
A quick way to find all the forks of a particular github project. see: https://github.com/akumria/findforks for a version which works now
#!/usr/bin/env python
import os
import urllib2
import json
import subprocess
user=None
repo=None
package main
import (
"fmt"
"runtime"
"time"
)
func waitAround(die chan bool) {
<- die
@sachac
sachac / emacsconf2013-sacha.org
Created March 31, 2013 00:04
Source code for my Emacs conference talk

Comments? sacha@sachachua.com

  • Emacs learning curve?

Meta information

Assumptions

  • Mix of Emacs geeks skewed towards people who’ve been using this for a while (after all, takes a certain commitment to come all the way to an Emacs conference!)

Outcomes

from xkcdplot import XKCDify
import numpy as np
import pylab
import scipy.stats
import matplotlib.pyplot as plt
ax = pylab.axes()
x = np.linspace(0,5,100)
y = np.linspace(0,np.pi/2,100)
ax.plot(x,scipy.stats.norm.pdf(x,0,1),'r',lw=1,label="productivity")
@aravindavk
aravindavk / sms-trends-android
Created April 8, 2013 18:22
SMS trends from Android phone