Skip to content

Instantly share code, notes, and snippets.

View jpoechill's full-sized avatar

Po Rith jpoechill

View GitHub Profile
@jpoechill
jpoechill / diagonal-bgs.css
Created June 3, 2017 21:36
Udacity's hp-css for diagonal bgs
.contain::before {
content: '';
width: 100%;
height: 660px;
z-index: -1000;
background: linear-gradient(to bottom right, #F7F7F7, #EAFBFF);
transform-origin: left bottom;
position: absolute;
top: 0;
left: 0;
@jpoechill
jpoechill / linkedList-01.js
Created June 5, 2017 03:57
Linked Lists with JS
// From ThatJSDude, http://thatjsdude.com/interview/linkedList.html#singlyLinkedList
function linkedList () {
this.head = null
}
linkedList.prototype.push = function (val) {
var node = {
value: val,
next: null
@jpoechill
jpoechill / linkedList-02.js
Created June 5, 2017 04:25
Linked Lists with JS
// from Tutsplus, https://code.tutsplus.com/articles/data-structures-with-javascript-singly-linked-list-and-doubly-linked-list--cms-23392
function Node(data) {
this.data = data;
this.next = null;
}
function SinglyList() {
this._length = 0;
this.head = null;
@jpoechill
jpoechill / myLinkedLists.js
Created June 5, 2017 05:11
Customized Linked Lists with Javascript
// From ThatJSDude
function linkedList () {
this.head = null
this.length = 0
}
linkedList.prototype.push = function (val) {
var node = {
value: val,
@jpoechill
jpoechill / stacksnQueues.js
Created June 5, 2017 06:04
Simple stacks and Queues with Javascript
var stack = []
stack.push(1)
console.log(stack)
stack.pop()
console.log(stack)
var queue = []
@jpoechill
jpoechill / clientside-webscraper.js
Created August 16, 2019 20:52
A simple client-side web scraper setup.
import axios from 'axios'
// a proxy server is not always needed for all sites
// though in some cases, sites will restrict access to those that are not same-origin
// in such case, proxy servers can be used to bypass, as seen here using https://cors-anywhere.herokuapp.com/.
axios.get('https://cors-anywhere.herokuapp.com/https://designboom.com', { crossdomain: true }).then((response) => {
// returns raw html which can be used subsequently as DOM nodes
console.log(response.data)