Skip to content

Instantly share code, notes, and snippets.

@ojas
ojas / Company Info
Created June 16, 2014 15:57
D&B Direct APEX Code
<apex:page standardController="Account">
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript" src="https://dnbdirectapps-cdn.s3.amazonaws.com/dnbapi.js">{API_BASE:'/apex/dnbdirect?_uri=:uri&_body=:data'}</script>
<script type="text/javascript" src="https://dnbdirectapps-cdn.s3.amazonaws.com/components/ui/ui.js"></script>
<div style="width:600px">
<div class="search_shell">
<form onSubmit="return false" class="dnbDemo">
<input type="text" id="companyname" placeholder="Company Name" class="dnb-ui-theme-light" style="font-size: 17px;height:34px;width:300px" />
@ojas
ojas / Curator's Code
Last active August 29, 2015 14:04
Apple Emojis
ᔥ stands for “via” and signifies a direct link of discovery, to be used when you simply repost a piece of content you found elsewhere, with little or no modification or addition. This type of attribution looks something like this:
↬ stands for the common “HT” or “hat tip,” signifying an indirect
@ojas
ojas / Auto Manufacturers Model Name Laziness Score.md
Last active August 29, 2015 14:05
Auto Manufacturers Model Name Laziness Score

Car Model Name Laziness Score

Summary

Make Laziness Score
Volvo 100.0
Acura 100.0
Scion 100.0
Fiat 100.0
@ojas
ojas / excel_comments_export.vba
Created October 3, 2014 15:55
Office Macros
' via http://www.extendoffice.com/documents/excel/1579-excel-export-comments-to-word.html
Sub CopyCommentsToWord()
'Update 20140325
Dim xComment As Comment
Dim wApp As Object
On Error Resume Next
Set wApp = GetObject(, "Word.Application")
If Err.Number <> 0 Then
Err.Clear
@ojas
ojas / birthday_problem
Last active August 29, 2015 14:15
Notebooks
{
"metadata": {
"name": "",
"signature": "sha256:0c025d13898e4457f1df2d19f109c610049acaa5b621e1c9aa0135551011f5f1"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
@ojas
ojas / monty hall
Created February 9, 2015 22:07
Monty Hall
{
"metadata": {
"name": "",
"signature": "sha256:54dd0380143918c25eba34914e70f3100831189ab021b2871dcf92f0b5cce9d3"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
@ojas
ojas / Requirements Cat PS1 Reverse Zeno
Created March 28, 2013 14:49
Requirements Cat: PS1: Reverse Zeno Paradox
<sharmaskarma> how can we build before we know the requirement
<sharmaskarma> KNOW THE REQUIREMENT
<ojas> how can you really know the requirement? it's like reverse zeno's
paradox.... you know you must end up at a requirement (at t1), but when you
start (t0) you have no requirement. there must be some point between t0 and t1
where half of the requirement is known, and between t0 and that point where one
half of one half of the requirement is known, and so on...
<ojas> but not matter how far you go back, you can never start w/ zero
requirement. hence, it's impossible to even get a single requirment defined.
QED
@ojas
ojas / gist:5489837
Created April 30, 2013 16:22
csvkit examples
csvsql --db sqlite+pysqlite:///test.db -e iso-8859-1 --insert ./test-file-209.csv
@ojas
ojas / with-blocks.py
Created August 9, 2013 21:34
with-blocks in python
class MyClass():
def __init__(self, *args, **kwargs):
print '>> init'
self.label = kwargs.get('label')
def __enter__(self):
print ' >> enter'
return self
def __exit__(self, type, value, traceback):