Skip to content

Instantly share code, notes, and snippets.

View ilovejs's full-sized avatar
🐡

Hao ilovejs

🐡
  • 16:32 (UTC +10:00)
View GitHub Profile
@ilovejs
ilovejs / markdownRef.md
Created December 19, 2014 01:07
CMD markdown cheatsheet

Sample Markdown Cheat Sheet

This is a sample markdown file to help you write Markdown quickly :)

If you use the fabulous [Sublime Text 2/3 editor][ST] along with the [Markdown Preview plugin][MarkdownPreview], open your ST2 Palette with CMD+⇧+P then choose Markdown Preview in browser to see the result in your browser.

Text basics

this is italic and this is bold . another italic and another bold

package org.rivendell.collections;
import java.lang.reflect.Array;
public class SkipListNode<T extends Comparable<? super T>> {
private final T value;
private final SkipListNode<T>[] next;
/**
* this is to provide index based access
package main
import (
"flag"
"fmt"
"log"
"net/rpc"
"sync"
"time"
)
@ilovejs
ilovejs / designer.html
Created March 18, 2015 03:03
designer
<link rel="import" href="../notification-elements/notification-alert.html">
<link rel="import" href="../topeka-elements/category-images.html">
<link rel="import" href="../core-icon/core-icon.html">
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../core-icons/av-icons.html">
<link rel="import" href="../paper-fab/paper-fab.html">
<polymer-element name="my-element">
<template>
@ilovejs
ilovejs / flatten.clj
Created April 2, 2015 06:25
recursive function in clojure
(defn flat [x]
(if (coll? x)
(if (empty? x)
[]
(concat (flat (first x)) (flat (rest x))))
[x]))
(flat '((1 2) 3 [4 [5 6]]))
# Fibonacci numbers WITH memoization.
# Initialize the memoization hash.
@scratchpad = {}
@max_fibo_size = 1_000_000_000_000
# Calculate the nth Fibonacci number, f(n).
def fibo (n)
val = if n <= 1
n
@ilovejs
ilovejs / index.html
Last active August 29, 2015 14:19 — forked from ains/index.html
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
</head>
<body>
</body>
# Author: Pieter Noordhuis
# Description: Simple demo to showcase Redis PubSub with EventMachine
#
# Update 7 Oct 2010:
# - This example does *not* appear to work with Chrome >=6.0. Apparently,
# the WebSocket protocol implementation in the cramp gem does not work
# well with Chrome's (newer) WebSocket implementation.
#
# Requirements:
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby
@ilovejs
ilovejs / LabelExtensions.cs
Created July 15, 2015 01:17
MVC Mandatory Field Label For Helper
using System;
using System.Linq;
using System.Linq.Expressions;
using System.Web.Mvc;
using System.Web.WebPages;
namespace RegistrationSample.UI.Web.mvcHelper
{
/// <summary>
/// Mandatory Field Extension
PdfLatex is a tool that converts Latex sources into PDF. This is specifically very important for researchers, as they use it to publish their findings. It could be installed very easily using Linux terminal, though this seems an annoying task on Windows. Installation commands are given below.
* Install the TexLive base
$ sudo apt-get install texlive-latex-base
* Also install the recommended and extra fonts to avoid running into the error [1], when trying to use pdflatex on latex files with more fonts.
$ sudo apt-get install texlive-fonts-recommended
$ sudo apt-get install texlive-fonts-extra
* Install the extra packages,