Skip to content

Instantly share code, notes, and snippets.

View leeyspaul's full-sized avatar
probably writing something.

Paul leeyspaul

probably writing something.
View GitHub Profile
ryunp / odd_sort.js
Created September 22, 2016 01:46 JS 'kata': Sort ascending odd numbers but even numbers must be on their places.
You have an array of numbers.
Your task is to sort ascending odd numbers but even numbers must be on their places.
Zero isn't an odd number and you don't need to move it. If you have an empty array, you need to return it.
sortArray([5, 3, 2, 8, 1, 4]) == [1, 3, 2, 8, 5, 4]
thegitfather /
Last active July 16, 2024 15:33
Vanilla JavaScript Quick Reference / Cheatsheet
afshinator / js-focus-on-functions
Last active January 7, 2021 17:17
Javascript - Focus on Functions
### Using callbacks in JavaScript (how to pass functions as arguments to other functions)
function doSomethingCool() {
$('someElement').click( doSomethingCool );
netpoetica / Setting up Nginx on Your Local
Last active May 28, 2024 15:01
Setting up Nginx on Your Local System

#Setting up Nginx on Your Local System ###by Keith Rosenberg

##Step 1 - Homebrew The first thing to do, if you're on a Mac, is to install homebrew from

The command to type into terminal to install homebrew is:

ruby -e "$(curl -fsSL"
gschema /
Last active November 27, 2023 04:35
Basic JavaScript MVC Implementation

Basic JavaScript MVC Implementation

Despite being derived from classical MVC pattern JavaScript and the environment it runs in makes Javascript MVC implementation have its own twists. Lets see how typical web MVC functions and then dive into simple, concrete JavaScript MVC implementation.

How Web MVC typically works

Typical server-side MVC implementation has one MVC stack layered behind the singe point of entry. This single point of entry means that all HTTP requests, e.g. or etc., are routed, by a server configuration, through one point or, to be bold, one file, e.g. index.php.

At that point, there would be an implementation of Front Controller pattern which analyzes HTTP request (URI at first place) and based on it decides which class (Controller) and its method (Action) are to be invoked as a response to the request (method is name for function and member is name for a variable when part of the class/object).

triceam / index.html
Created August 20, 2012 19:44
JavaScript Templating Example to show rendering techniques of JS data in HTML or XML formats.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
<title>JSON Transform</title>
<script type="text/javascript" src=""></script>
<script type="text/javascript" src=""></script>
<script type="text/javascript" src=""></script>
<link href="" rel="stylesheet"></link>