Skip to content

Instantly share code, notes, and snippets.

View prabinv's full-sized avatar

Prabin Varma prabinv

View GitHub Profile
@prabinv
prabinv / Layout.tsx
Created April 23, 2022 18:23
Remix Presentation Code
const Layout: React.FC = ({ children }) => (
<div id="layout" className="pure-g">
<div className="sidebar pure-u-1 pure-u-md-1-4">
<div className="header">
<nav className="nav">
<ul className="nav-list">
<li className="nav-item">
<a className="pure-button" href="https://remix.run">Remix</a>
</li>
</ul>
@prabinv
prabinv / machine.js
Created April 4, 2021 21:45
Generated by XState Viz: https://xstate.js.org/viz
const trafficLightMachine = Machine({
// Machine identifier
id: 'light',
// Initial state
initial: 'red',
// Local context for entire machine
context: {
elapsed: 0,
@prabinv
prabinv / machine.js
Last active February 18, 2021 23:37
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
Verifying my Blockstack ID is secured with the address 1EHFL2iEsXD3Qs7HNEqfUvh4MMBwBM9voo https://explorer.blockstack.org/address/1EHFL2iEsXD3Qs7HNEqfUvh4MMBwBM9voo
@prabinv
prabinv / glamorous-button.js
Created June 8, 2017 20:31
CSS-in-JS comparision
import glamorous from 'glamorous';
const getStylesFromPropsAndTheme = (props, theme) => {
const background = props.disabled
? '#cfcdc6'
: props.raised
? '#F27860'
: '#ACA99D';
const boxShadow = props.disabled
? undefined

Keybase proof

I hereby claim:

  • I am prabinv on github.
  • I am prabin (https://keybase.io/prabin) on keybase.
  • I have a public key ASBgSHk7CRkUSFKXU9n4ar9LaDeqGPleP7mE4WStJiqdrwo

To claim this, I am signing this object:

function cartesianProductOf(...args) {
return _.reduce(args, function(a, b) {
return _.flatten(_.map(a, function(x) {
return _.map(b, function(y) {
return x.length > 0 ? `${x}:${y}` : y;
});
}), true);
}, [ [] ]);
};
@prabinv
prabinv / PrerenderDetection.asp
Last active August 29, 2015 14:21
Prerender Middleware Code - ASP
<%
Const dictKey = 1
Const dictItem = 2
Class PrerenderRequest
Public RequestUrl
Public RequestedPage
Public RequestMethod
Public QueryStrings
Public UserAgent
@prabinv
prabinv / vn-data-cache.js
Created February 12, 2015 19:11
Trying out a caching service
'use strict';
/**
* @ngdoc service
* @name Volusion.toolboxCommon.vnDataCache
* @requires $cacheFactory
* @requires $q
* @description
*
* # vnDataCache
* The `vnDataCache` service allows the result of a promise to be cached and if the data is present in the cache, it is returned as a Promise.
body {
padding: 0;
margin: 0;
background: #3FA8C6;
background-image: -moz-linear-gradient(top, #3fa8c6 0%, #3fa8c6 0%, #399ab2 100%);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#3fa8c6), color-stop(0%,#3fa8c6), color-stop(100%,#399ab2));
background-image: -webkit-linear-gradient(top, #3fa8c6 0%,#3fa8c6 0%,#399ab2 100%);
background-image: -o-linear-gradient(top, #3fa8c6 0%,#3fa8c6 0%,#399ab2 100%);
background-image: -ms-linear-gradient(top, #3fa8c6 0%,#3fa8c6 0%,#399ab2 100%);