Skip to content

Instantly share code, notes, and snippets.

View blenderskool's full-sized avatar
💭
Thinking...

Akash Hamirwasia blenderskool

💭
Thinking...
View GitHub Profile
@blenderskool
blenderskool / server.py
Created June 9, 2020 16:46 — forked from martijnvermaat/server.py
SimpleHTTPServer with history API fallback
#!/usr/bin/env python
"""
Modification of `python -m SimpleHTTPServer` with a fallback to /index.html
on requests for non-existing files.
This is useful when serving a static single page application using the HTML5
history API.
"""
@blenderskool
blenderskool / starter.svelte
Last active September 29, 2019 14:57
Sample Svelte component
<!-- Script -->
<script>
export let name = 'world';
let num = 5;
function sayHello() {
console.log(`Hello ${name}`);
}
</script>
/**
* Peer 1 (Sender)
* Peer 2 (Receiver)
* This example has both the peers in the same browser window.
* In a real application, the peers would exchange their signaling data for a proper connection.
* The signaling server part is omitted for simplicity
*/
const peer1 = new SimplePeer({ initiator: true });
const peer2 = new SimplePeer();
@blenderskool
blenderskool / spiral.py
Last active June 12, 2019 16:03
Generates a spiral pattern
# This program generates a number spiral based on number entered by user
# Example: If input is 4, output is
# 01 02 03 04
# 12 13 14 05
# 11 16 15 06
# 10 09 08 07