Skip to content

Instantly share code, notes, and snippets.

View rameshanandakrishnan's full-sized avatar

Ramesh Anandakrishnan rameshanandakrishnan

View GitHub Profile
{
"extends": [
"tslint:recommended",
"tslint-react",
"tslint-plugin-prettier",
"tslint-config-prettier"
],
"linterOptions": {
"exclude": ["config/**/*.js", "node_modules/**/*.ts"]
},
If you're using Linux, you can also follow this official wiki pages:
click the lock icon with an X,
choose Certificate Information
go to Details tab
Click on Export... (save as a file)
Now, the following command will add the certificate (where YOUR_FILE is your exported file):
certutil -d sql:$HOME/.pki/nssdb -A -t "P,," -n YOUR_FILE -i YOUR_FILE
**********HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<script src="https://cdnjs.cloudflare.com/ajax/libs/redux/3.3.1/redux.min.js"></script>
<script src="https://fb.me/react-with-addons-0.14.7.min.js"></script>
<script src="https://fb.me/react-dom-0.14.7.min.js"></script> <title>Document</title>
</head>
<body>
@rameshanandakrishnan
rameshanandakrishnan / gist:5d2bbaf34627c1a99dcad0dd1b628e23
Created April 5, 2016 17:40
First react counter example without react
function counter(state, action) {
if (typeof state === 'undefined') {
return 0;
}
if (action.type === 'INCREMENT') {
return state + 1;
} else if (action.type === 'DECREMENT'){
return state -1;
}else {
@rameshanandakrishnan
rameshanandakrishnan / flightplan-deploy.md
Created November 23, 2015 15:54 — forked from learncodeacademy/flightplan-deploy.md
Deploy Node.js Apps with Flightplan

##Setup your server (this would ideally be done with automated provisioning)

  • add a deploy user with password-less ssh see this gist
  • install forever npm install -g forever

##Install flightplan

  • npm install -g flightplan
  • in your project folder npm install flightplan --save-dev
  • create a flightplan.js file
@rameshanandakrishnan
rameshanandakrishnan / gist:cea2ae42be7e01ed88f0
Created September 1, 2015 16:49
Shopify support multiple gift wrapping options - modified Caroline Schnapp's gift wrapper code
<!-- Add a flat charge per order -->
<!-- DO NOT REMOVE THE FOLLOWING COMMENT -->
<!-- (c) Copyright 2014 Caroline Hill. All Rights Reserved. Contact Mlle Caroline Schnapp at mllegeorgesand@gmail.com -->
<!-- DO NOT REMOVE THE ABOVE COMMENT -->
{% if linklists.gift-wrapping.links.size > 0 and linklists.gift-wrapping.links.first.type == 'product_link' %}
<div id="is-a-gift" class="clearfix rte">
{% for variant in linklists.gift-wrapping.links.first.object.variants %}
<p>
// Returns a function, that, as long as it continues to be invoked, will not
// be triggered. The function will be called after it stops being called for
// N milliseconds. If `immediate` is passed, trigger the function on the
// leading edge, instead of the trailing.
// **to be used with resize, key event, scroll
function debounce(func, wait, immediate) {
var timeout;
return function() {
var context = this, args = arguments;
var later = function() {
function once(fn, context) {
var result;
return function() {
if(fn) {
result = fn.apply(context || this, arguments);
fn = null;
}
return result;
var getAbsoluteUrl = (function() {
var a;
return function(url) {
if(!a) a = document.createElement('a');
a.href = url;
return a.href;
};
})();
@rameshanandakrishnan
rameshanandakrishnan / Shopify Blog Archives
Last active August 29, 2015 14:26 — forked from zakhardage/Shopify Blog Archives
Archives widget for shopify blog sidebar
{% capture dates %}2013 2014 2015 2016 2017 2018 2019 2020{% endcapture %}
{% capture tags %}{% for tag in blog.all_tags %}{{ tag }} {% endfor %}{% endcapture %}
<div id="categories" class="widget">
<h2>Categories</h2>
{% for tag in blog.all_tags %}
{% assign check = tag | downcase | split:' ' %}
{% unless dates contains check[0] %}
<a href="{{ blog.url }}/tagged/{{ tag | handle }}">{{ tag }}</a>
{% endunless %}
{% endfor %}