Skip to content

Instantly share code, notes, and snippets.

View mayank-patel's full-sized avatar
💭
Engineering Leader | Lover of JavaScript

Mayank Patel mayank-patel

💭
Engineering Leader | Lover of JavaScript
View GitHub Profile
@mayank-patel
mayank-patel / index.html
Created March 16, 2013 06:05
A CodePen by Mayank Patel. Image Circle
<span class="image-wrap "></span>
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
green='\033[0;32m'

How to set up stress-free SSL on an OS X development machine

One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.

Most workflows make the following compromises:

  • Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the secure flag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection.

  • Use production SSL certificates locally. This is annoying

ECMA Script 6

Destructuring Assignments

var options = {
        repeat: true,
        save: false
 };
@mayank-patel
mayank-patel / data.txt
Created February 10, 2018 22:01
GradientDescent-1 created by mayank_patel - https://repl.it/@mayank_patel/GradientDescent-1
1.056677202783558398e-03 9.978778502507325010e-01 -6.510514121223956452e-02
7.043345086177190718e-03 8.619406181060673688e-01 5.069603161480468190e-01
1.096581294917764807e-03 9.993803324853308689e-01 -3.518165077100719046e-02
3.086498603763945109e-03 9.663098085226217160e-01 -2.573632209142230343e-01
2.642737535157429259e-03 9.815388079539708599e-01 1.912448284754857120e-01
6.539354520247366714e-03 9.990389530558135833e-01 -4.334059436143443411e-02
2.858284244543610186e-03 9.841803696112890742e-01 1.771463527227239432e-01
1.096679903559064518e-03 9.944694752895311129e-01 -1.050202838053379967e-01
4.157424194778805773e-03 9.547604393415243251e-01 2.973469678548014139e-01
1.584987717469599731e-03 9.976945712631188901e-01 6.784563571842117113e-02
@mayank-patel
mayank-patel / data.txt
Created February 10, 2018 22:01
GradientDescent-1 created by mayank_patel - https://repl.it/@mayank_patel/GradientDescent-1
1.056677202783558398e-03 9.978778502507325010e-01 -6.510514121223956452e-02
7.043345086177190718e-03 8.619406181060673688e-01 5.069603161480468190e-01
1.096581294917764807e-03 9.993803324853308689e-01 -3.518165077100719046e-02
3.086498603763945109e-03 9.663098085226217160e-01 -2.573632209142230343e-01
2.642737535157429259e-03 9.815388079539708599e-01 1.912448284754857120e-01
6.539354520247366714e-03 9.990389530558135833e-01 -4.334059436143443411e-02
2.858284244543610186e-03 9.841803696112890742e-01 1.771463527227239432e-01
1.096679903559064518e-03 9.944694752895311129e-01 -1.050202838053379967e-01
4.157424194778805773e-03 9.547604393415243251e-01 2.973469678548014139e-01
1.584987717469599731e-03 9.976945712631188901e-01 6.784563571842117113e-02
@mayank-patel
mayank-patel / s3-static-hosting-policy
Created September 6, 2018 04:03
s3-static-hosting-policy
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PublicReadGetObject",
"Effect": "Allow",
"Principal": {
"AWS": "*"
},
"Action": "s3:GetObject",