Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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 / 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,
}
[
["Days", "Orders", "Items ", "AOV", "Average Item/Order"],
["14-Dec-13", 45, 90, 45, 2],
["15-Dec-13", 15, 40, 23, 2.5]
]
@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);
@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 / import-export
Last active December 24, 2015 00:58
MongoDB tips
# Load a MongoDB collection with test data
## Let's load some sample data in mongo
curl -s 'http://www.json-generator.com/j/cdQGOkHUoi?indent=4' | mongoimport --db playpen --collection people --jsonArray
mongo playpen
## Create facets based on this [walkthru](http://blog.mongodb.org/post/59757486344/faceted-search-with-mongodb)
db.people.ensureIndex({"facets3.age" : 1})
@ojas
ojas / duns.txt
Created September 22, 2013 15:59
Example DUNS
214567885
247933872
302150912
362241452
362328580
362528379
364744867
481794956
654502665
754683795
@ojas
ojas / resize
Created September 20, 2013 17:40
ImageMagick tips
convert Sreeni3.png -resize 600x400 -gravity Center -crop 400x400+0+0 +repage sreeni.jpg