Skip to content

Instantly share code, notes, and snippets.

@stamaniorec
stamaniorec / circle-avatar.html
Created June 20, 2016 18:10
A simple circle avatar which gets a bit bigger on hover
<!DOCTYPE html>
<html>
<head>
<title>Circle avatar</title>
<style type="text/css">
.avatar {
display: block;
width: 200px;
height: 200px;
@stamaniorec
stamaniorec / random-word.sh
Created June 20, 2016 18:08
A bash script which retrieves a random word
#!/bin/bash
dictionary=/usr/share/dict/american-english
length="\+"
while getopts ":d:n:" opt; do
case $opt in
d)
dictionary="$OPTARG"
;;
@stamaniorec
stamaniorec / pyroedu_header.html
Last active June 16, 2016 11:54
Learning responsive web design by remaking the PyroEDU header
<!DOCTYPE html>
<html>
<head>
<title>Pyro</title>
<style type="text/css">
body { margin: 0; font-size: 16px; }
h1, h2 { margin: 0; }
.wrapper { width: 70%; margin: 0 auto; }
#main-header {
@stamaniorec
stamaniorec / menu.html
Created June 16, 2016 11:52
A simple responsive dropdown menu
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta name="viewport" content="width=device_width">
<style type="text/css">
ul {
padding: 0;
background-color: #333;
@stamaniorec
stamaniorec / bubble-fptr.c
Created June 16, 2016 11:38
Learning about function pointers in C by implementing bubble sort with a comparator
#include <stdio.h>
int sort_by_asc(int a, int b)
{
if(a < b) return 0;
return 1;
}
int sort_by_dsc(int a, int b)
{
@stamaniorec
stamaniorec / tabs.html
Created June 16, 2016 08:29
Implementing my own simple tabs
<!DOCTYPE html>
<html>
<head>
<title>Tabs</title>
<style type="text/css">
body { margin: 0; }
nav ul {
background-color: #222;
@stamaniorec
stamaniorec / accordion.html
Created June 16, 2016 06:10
A simple CSS accordion
<!DOCTYPE html>
<html>
<head>
<title>Accordion</title>
<style type="text/css">
p { margin: 0; }
.accordion h2 { cursor: pointer; }
@stamaniorec
stamaniorec / push-over-menu.html
Created June 15, 2016 20:08
Very basic push over menu I whipped up in a few minutes
<!DOCTYPE html>
<html>
<head>
<title>Push over menu</title>
<style type="text/css">
ul, p { margin: 0; }
span.toggler { display: block; width: 20px; height: 20px; background-color: white; position: absolute; top: 5px; left: 5px; }
@stamaniorec
stamaniorec / pascal_triangle.py
Created June 15, 2016 12:23
Pascal triangle
from __future__ import print_function
def sum_one_to_n(n):
return (n * (n + 1)) / 2
def get_index(row, col):
return sum_one_to_n(row) + col
def get_value(row, col, l):
if col < 0:
@stamaniorec
stamaniorec / index.html
Created June 8, 2016 08:48
Playing with Backbone
<!DOCTYPE html>
<html>
<head>
<title>My webapp</title>
<style type="text/css">
#imp-table, #imp-table tr, #imp-table td {
border: 1px solid black;
border-collapse: collapse;
}