Skip to content

Instantly share code, notes, and snippets.

View mauryaratan's full-sized avatar
🦌

Ram Ratan Maurya mauryaratan

🦌
View GitHub Profile
@mauryaratan
mauryaratan / javascript_resources.md
Created April 17, 2014 15:43 — forked from jookyboi/javascript_resources.md
Here are a set of libraries, plugins and guides which may be useful to your Javascript coding.

Libraries

  • jQuery - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
  • Backbone - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
  • AngularJS - Conventions based MVC framework for HTML5 apps.
  • Underscore - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
  • lawnchair - Key/value store adapter for indexdb, localStorage
@mauryaratan
mauryaratan / css_resources.md
Created April 17, 2014 15:43 — forked from jookyboi/css_resources.md
CSS libraries and guides to bring some order to the chaos.

Libraries

  • 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
  • Compass - Open source CSS Authoring Framework.
  • Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
  • Font Awesome - The iconic font designed for Bootstrap.
  • Zurb Foundation - Framework for writing responsive web sites.
  • SASS - CSS extension language which allows variables, mixins and rules nesting.
  • Skeleton - Boilerplate for responsive, mobile-friendly development.

Guides

@mauryaratan
mauryaratan / gist:e507addaf8f2924db360
Created July 16, 2014 19:39
onename.io verification
Verifying myself: My Bitcoin username is +mauryaratan. https://onename.io/mauryaratan
@mauryaratan
mauryaratan / st3-settings.json
Last active August 29, 2015 14:05
My Sublime Text settings.
{
"bold_folder_labels": true,
"caret_extra_width": 1,
"color_scheme": "Packages/Theme - Spacegray/base16-ocean.dark.tmTheme",
"draw_white_space": "selection",
"ensure_newline_at_eof_on_save": true,
"file_exclude_patterns":
[
"*.DS_Store",
"*config.codekit",
@mauryaratan
mauryaratan / public-access.json
Created August 14, 2014 11:15
Set Amazon S3 to allow requests publicly. Make sure to replace 'Codestag' with your Amazon bucket name.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AddPerm",
"Effect": "Allow",
"Principal": {
"AWS": "*"
},
"Action": "s3:GetObject",
# Install dependencies
#
# * checkinstall: package the .deb
# * libpcre3, libpcre3-dev: required for HTTP rewrite module
# * zlib1g zlib1g-dbg zlib1g-dev: required for HTTP gzip module
apt-get install checkinstall libpcre3 libpcre3-dev zlib1g zlib1g-dbg zlib1g-dev && \
OLD_DIR=`pwd` && \
WDIR=~/sources/ && \
OPENSSL_VER=1.0.2 && \
pagespeed on;
# Needs to exist and be writable by nginx. Use tmpfs for best performance.
pagespeed FileCachePath /var/ngx_pagespeed_cache;
# Ensure requests for pagespeed optimized resources go to the pagespeed handler
# and no extraneous headers get set.
location ~ "\.pagespeed\.([a-z]\.)?[a-z]{2}\.[^.]{10}\.[^.]+" {
add_header "" "";
}
@mauryaratan
mauryaratan / random-color.php
Created February 7, 2016 11:30
Generate a random color string in PHP.
<?php
function random_color_value() {
return str_pad( dechex( mt_rand( 0, 255 ) ), 2, '0', STR_PAD_LEFT );
}
function random_color() {
return random_color_value() . random_color_value() . random_color_value();
}

Keybase proof

I hereby claim:

  • I am mauryaratan on github.
  • I am mauryaratan (https://keybase.io/mauryaratan) on keybase.
  • I have a public key whose fingerprint is F252 EF6D FB8D 11BB 9DCE CC0D 496A 6132 0080 FF1D

To claim this, I am signing this object:

@mauryaratan
mauryaratan / chrome-snippets.json
Created July 28, 2017 12:44
Google Chrome Snippets, can be imported/exported from here https://gist.github.com/soundyogi/03df95505604c8351212 since Chrome doesn't offers any methods to sync it.
{
"snippets": [
{
"name": "dataurl.js",
"content": "// dataurl.js\n// https://github.com/bgrins/devtools-snippets\n// Print out data URLs for all images / canvases on the page.\n\n((() => {\n\n console.group(\"Data URLs\");\n\n [].forEach.call(document.querySelectorAll(\"img\"), i => {\n const c = document.createElement(\"canvas\");\n const ctx = c.getContext(\"2d\");\n c.width = i.width;\n c.height = i.height;\n\n try {\n ctx.drawImage(i, 0, 0);\n console.log(i, c.toDataURL());\n }\n catch(e) {\n console.log(i, \"No Permission - try opening this image in a new tab and running the snippet again?\", i.src);\n }\n });\n\n [].forEach.call(document.querySelectorAll(\"canvas\"), c => {\n try {\n console.log(c, c.toDataURL());\n }\n catch(e) {\n console.log(c, \"No Permission\");\n }\n });\n\n console.groupEnd(\"Data URLs\");\n\n}))();"
},
{
"name": "jqueryify.js",
"content": "// jquerify.js\n// https://github.c