Skip to content

Instantly share code, notes, and snippets.

View shidhincr's full-sized avatar
🔥
= VS Code + VIM

Shidhin shidhincr

🔥
= VS Code + VIM
View GitHub Profile
@shidhincr
shidhincr / dabblet.css
Created December 16, 2011 05:17 — forked from anonymous/dabblet.css
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
.shidhin{
background-color:#efe;
color:#789;
width:100px;
height:30px;
}
@shidhincr
shidhincr / dabblet.css
Created December 16, 2011 05:33
Untitled
body{
background-color:#fff;
}
.shidhin {
background-color:#fff;
color:#789;
width:100px;
height:30px;
margin:100px 100px;
padding:10px;
@shidhincr
shidhincr / dabblet.css
Created March 20, 2012 07:10 — forked from JoelBesada/dabblet.css
CSS States
/* CSS States */
body {
background: url(http://dabblet.com/img/noise.png);
background-color: #F5F2F0;
font-family: Georgia, serif;
font-size: 18px;
line-height: 1.6em;
text-shadow: 0 2px 0 white;
color: #222;
}
@shidhincr
shidhincr / dateutil.js
Created September 3, 2012 14:22 — forked from remy/dateutil.js
Super simple library for date time formatting.
var dateUtil = function () {
var monthDict = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
return {
time: function (date) {
var hour = date.getHours(),
min = date.getMinutes() + "",
ampm = 'AM';
if (hour == 0) {
hour = 12;
@shidhincr
shidhincr / functionCurry.js
Created August 14, 2013 11:50
Example of Function Currying JavaScript - With Buster Specs
/**
* Curry function
*/
function curryFn(a, b, c, x, y, z) {
"use strict";
var output = 1, args = [].slice.call(arguments),i,len, finalArgs;
curryFn.__args = ( curryFn.__args || [] ).concat( args );
@shidhincr
shidhincr / changes.html
Created October 15, 2013 09:54
Octopress blog updates
<p class="meta">
{% include custom/aboutauthor.html %}
</p>
<div>
<article class="hentry" role="article">
{% include article.html %}
<footer>
<p class="meta">
{% include post/author.html %}
{% include post/date.html %}{% if updated %}{{ updated }}{% else %}{{ time }}{% endif %}
{% include post/categories.html %}
</p>
{% unless page.sharing == false %}
@shidhincr
shidhincr / curry.js
Created November 5, 2013 07:45
JavaScript Implementation of function currying - By adding a curry method to the Function prototype
Function.prototype.curry = function( ) {
var slice = Array.prototype.slice,
self = this,
totalargs = self.length,
partial = function( args, fn ) {
return function( ) {
return fn.apply( {}, args.concat( slice.call( arguments ) ) );
}
},
fn = function( ) {
@shidhincr
shidhincr / dabblet.css
Created December 11, 2013 10:41
Untitled
body {
background-color: #f1f1f1;
font-family: Helvetica,Arial,Verdana;
}
h1 {
color: green;
text-align: center;
}
.redfamily {
@shidhincr
shidhincr / desc.md
Created February 23, 2014 19:19 — forked from odino/desc.md

Coding challenge: cartified!

Hey JavaScript talents, here at namshi.com, we are looking for you! Submit this coding challenge to alex.nadalin@namshi.com and we'll get back to you as soon as possible!

Your task is to implement a basic shopping cart for a website, following these basic rules:

  • the cart needs to be implemented as an AngularJS service
  • the cart should be retrieved from the localStorage, where it's stored under the key cart
  • every time an action is performed on the cart, it should be persisted on the localStorage
  • the cart should only know about item IDs and their quantity