Skip to content

Instantly share code, notes, and snippets.

View maxpert's full-sized avatar

Zohaib Sibte Hassan maxpert

View GitHub Profile

An exhibit of Markdown

This note demonstrates some of what Markdown Syntax is capable of doing.

Note: Feel free to play with this page. Unlike regular notes, this doesn't automatically save itself.

Basic formatting

Paragraphs can be written like so. A paragraph is the basic block of Markdown. A paragraph is what text will turn into when there is no reason it should become anything else.

Paragraphs must be separated by a blank line. Basic formatting of italics and bold is supported. This can be nested like so.

@maxpert
maxpert / MarkdownSharp.cs
Last active April 15, 2016 01:46
Markdown to WinRT XAML converter
/*
* MarkdownSharp
* -------------
* a C# Markdown processor
*
* Markdown is a text-to-HTML conversion tool for web writers
* Copyright (c) 2004 John Gruber
* http://daringfireball.net/projects/markdown/
*
* Markdown.NET
@maxpert
maxpert / Femto.js
Created May 24, 2011 17:16
Femto JS Templating
/**
The MIT License
Copyright (c) 2010 Zohaib Sibt-e-Hassan
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@maxpert
maxpert / restart_server.sh
Created August 20, 2016 00:50
A restart server shell script that daemonizes any
#!/bin/bash
server_id=`cat server.pid`
if kill -9 $server_id > /dev/null 2>&1; then
echo "Server killed" >&2
fi
# start and banground server here
./server > /dev/null 2>&1 &
@maxpert
maxpert / gist:0b81f2474cb402279711f86001262fec
Created August 25, 2016 19:55 — forked from jedi4ever/gist:903751
Tuning stuff for Ubuntu hosts
# /etc/security/limits.conf
* soft nofile 999999
* hard nofile 999999
root soft nofile 999999
root hard nofile 999999
===========================================================
# /etc/sysctl.conf
# sysctl for maximum tuning
@maxpert
maxpert / clearfix.css
Created May 30, 2011 11:04
Minimal clearfix
/* For modern browsers */
.cf:before,
.cf:after {
content:"";
display:block;
}
.cf:after {
clear:both;
}
@maxpert
maxpert / samples.yaml
Last active January 9, 2017 00:18
LUL
# Everything starting with a # is a comment
################################## 1-1-simple-example.rive
on: Hello bot
say: Hello human
################################## 1-2-replies.rive
# By default all statements live under start, this can be explicitly specified
start:
on: hello bot
say:
@maxpert
maxpert / sample.js
Created February 17, 2017 08:49
ES6 Iterators
function $range(...args) {
let [start, stop, step] = args
if (stop === undefined) {
stop = start
start = 0
}
let direction = start < stop ? 1 : -1
let i = start
step = step || (1 * direction)
@maxpert
maxpert / pubsub_test.go
Last active July 17, 2017 01:47
Golang Pub/Sub benchmarking
package rascore
import (
"testing"
"sync"
)
type info struct {
id int
}
@maxpert
maxpert / pipes.py
Last active July 26, 2017 15:28
Python pipe syntactic sugar
import inspect
class PipeFunction:
def __init__(self, func, *args, **kwargs):
self._func = func
self._args = args
self._kwargs = kwargs
def __call__(self, *args, **kwargs):
return self._append_params(*args, **kwargs)