Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Shrinivasan Neelamegam eshrinivasan

🏠
Working from home
Block or report user

Report or block eshrinivasan

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View simple-https-server.py
# taken from http://www.piware.de/2011/01/creating-an-https-server-in-python/
# generate server.xml with the following command:
# openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes
# run as follows:
# python simple-https-server.py
# then in your browser, visit:
# https://localhost:4443
import BaseHTTPServer, SimpleHTTPServer
import ssl
@eshrinivasan
eshrinivasan / README.md
Created Jun 11, 2019 — forked from pbojinov/README.md
Two way iframe communication- Check out working example here: http://pbojinov.github.io/iframe-communication/
View README.md

Two way iframe communication

The main difference between the two pages is the method of sending messages. Recieving messages is the same in both.

Parent

Send messages to iframe using iframeEl.contentWindow.postMessage Recieve messages using window.addEventListener('message')

iframe

@eshrinivasan
eshrinivasan / gist:f1755c80bb4d5107dc99ccc55c03ca81
Last active Jun 4, 2019
console log wrapper, debug statement, utility
View gist:f1755c80bb4d5107dc99ccc55c03ca81
/*
Universal debug utility
*/
View Prototype chaining and inheritance example
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
View CSS
block vs inline
id(one) vs class(many)
positioning
https://jsfiddle.net/nsshrinivasan/s06vtsvk/1/
https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layout/Positioning
View SASS
Mixins:
----
Example 1:
@mixin square($size, $color) {
width: $size;
height: $size;
background-color: $color;
}
@eshrinivasan
eshrinivasan / macbook_pro_battery
Created Jul 9, 2016
how to charge macbook pro battery
View macbook_pro_battery
For newer Mac portables (15-inch Double-Layer SD, all models of MacBook, and all models of MacBook Pro), follow these steps:
1. Plug in the power adapter and fully charge your PowerBook's battery until the light ring or LED on the power adapter plug changes to green and the onscreen meter in the menu bar indicates that the battery is fully charged.
2. Allow the battery to rest in the fully charged state for at least two hours. You may use your computer during this time as long as the adapter is plugged in.
3. Disconnect the power adapter while the computer still on and start running the computer off battery power. You may use your computer during this time. When your battery gets low, the low battery warning dialog appears on the screen.
4. At this point, save your work. Continue to use your computer; when the battery gets very low, the computer will automatically go to sleep.
5. Turn off the computer or allow it to sleep for five hours or more.
6. Connect the power adapter and leave it connected until the
View open link in a new window if the link is external
View memoryleaks
>> Accidental global variable
>> Circular references:
javascript obj = dom object;
dom object property = javascript obj;
>> Improper use of closures
>> SetInterval
-------------------
>>Algorithms
View call
function takesTwoParams(a, b){
var args = Array.prototype.slice.call(arguments);
alert(" your parameters were " + args.join(", "));
}
Let’s take a look at that a bit more in-depth:
Array: This object is the original array that all other arrays inherit their properties from.
Array.prototype:This gives us access to all the methods properties that each array inherits
You can’t perform that action at this time.