Skip to content

Instantly share code, notes, and snippets.

@ojas
ojas / people.json
Created September 27, 2013 16:28
Sample JSONs
[
{
"picture": "http://placehold.it/32x32",
"about": "Do do reprehenderit quis ipsum sit esse quis occaecat culpa enim excepteur. Consectetur deserunt pariatur laboris mollit eiusmod nulla exercitation nulla et aute aliqua commodo. Laboris irure ut cupidatat qui. Ut ut adipisicing cupidatat nisi sunt ipsum reprehenderit ullamco eiusmod incididunt sunt ullamco veniam tempor. Commodo reprehenderit tempor amet incididunt ea ea deserunt minim ex aliqua consectetur.\r\n",
"balance": "$1,651.00",
"name": "Hardy Davis",
"randomArrayItem": "cherry",
"phone": "+1 (881) 441-2106",
"gender": "male",
"age": 24,
@ojas
ojas / cornify.user.js
Last active August 27, 2022 18:31
User Scripts
// @include http://www.mozu.com/*
var script = document.createElement( 'script' );
script.type = 'text/javascript';
script.src = 'http://www.cornify.com/js/cornify.js';
script.onload = function() {
for(var i=0; i<12; i++) cornify_add();
}
document.head.appendChild(script);
[
["Days", "Orders", "Items ", "AOV", "Average Item/Order"],
["14-Dec-13", 45, 90, 45, 2],
["15-Dec-13", 15, 40, 23, 2.5]
]
@ojas
ojas / dnb_envs.py
Last active December 28, 2015 06:29
lulz
def enum(**enums):
return type('Enum', (), enums)
WORDS = enum(PARTIAL = 1, SANDBOX = 2, SCRAMBLED = 4, LEGACY = 8, PRODUCTION = 16, TRUNCATED = 32)
envs = {
'http://api.dnbdirectapps.com/dev/' : WORDS.SANDBOX + WORDS.PARTIAL + WORDS.SCRAMBLED + WORDS.TRUNCATED,
'http://dnbdirect-sandbox.dnb.com/' : WORDS.SANDBOX + WORDS.SCRAMBLED + WORDS.LEGACY,
'http://dnbdirect-api.dnb.com/' : WORDS.PRODUCTION,
}
@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 / MacTips.md
Last active October 5, 2016 00:16
Mac Tips

How to find what program's running on a given port

See what's running on port 80

sudo lsof -i :80

Restart Audio

sudo kill -9 `ps ax|grep 'coreaudio[a-z]' |awk '{print $1}'`
@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": [