This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function reverse(head) { | |
let nextNode = null; | |
let prevNode = null; | |
let currentNode = head; | |
while(currentNode) { | |
nextNode = currentNode.next; | |
currentNode.prev = nextNode; | |
currentNode.next = prevNode; | |
prevNode = currentNode; | |
currentNode = nextNode; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function rotLeft(a, d) { | |
if (a.length === d) return a; | |
// arrays are Non-Primitive data type so create a shallow copy | |
var copy = [...a]; | |
while(d) { | |
copy.push(copy.shift()); | |
d--; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import "./index.css"; | |
import React, { Component } from "react"; | |
class Accordion extends Component { | |
static defaultProps = { | |
onChange: () => {}, | |
statusIconsComponents: { | |
opened: "▲", | |
closed: "▼" | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ---- | |
// libsass (v3.2.4) | |
// ---- | |
%message { | |
border: 1px solid #ccc; | |
padding: 5px; | |
display: block; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ---- | |
// libsass (v3.2.4) | |
// ---- | |
%message { | |
border: 1px solid #ccc; | |
padding: 5px; | |
display: block; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ---- | |
// libsass (v3.2.4) | |
// ---- | |
%message { | |
border: 1px solid #ccc; | |
padding: 5px; | |
display: block; | |
} | |
.error { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ---- | |
// libsass (v3.2.4) | |
// ---- | |
%message { | |
border: 1px solid #ccc; | |
padding: 5px; | |
display: block; | |
} | |
.error { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var http = require("http"), | |
url = require("url"), | |
path = require("path"), | |
fs = require("fs") | |
port = process.argv[2] || 8888; | |
http.createServer(function(request, response) { | |
var uri = url.parse(request.url).pathname | |
, filename = path.join(process.cwd(), uri); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Working demo can be found on http://codepen.io/aamirafridi/pen/GcmHt | |
//HTML: <div>click me to animate</div> | |
function supportTransitions() { | |
var b = document.body || document.documentElement, | |
s = b.style, | |
p = 'transition', | |
e = { | |
'Webkit' : 'webkitTransitionEnd', |