Skip to content

Instantly share code, notes, and snippets.

View ender503's full-sized avatar
🖖
I come in peace - Star Trek

TingHan Su ender503

🖖
I come in peace - Star Trek
View GitHub Profile
@remarkablemark
remarkablemark / README.md
Last active November 12, 2023 07:52
Classes - ES5 vs ES6

JavaScript Classes - ES5 vs ES6

An example that shows the difference between creating a JavaScript class and subclass in ES5 and ES6.

Reference

@subfuzion
subfuzion / curl.md
Last active May 16, 2024 18:04
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@andycjw
andycjw / uao_decode.py
Last active September 22, 2017 08:24
Big5 UAO decode usage: just do 'import uao_decode.py' unicode_string = big5_string.decode('uao_decode')
import codecs
import struct
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
pass
def decode(self,input,errors='strict'):
unistr = u''
@butlermh
butlermh / lucene4cosine.java
Created January 30, 2013 12:32
Using Lucene 4 to calculate cosine similarity
import java.io.IOException;
import java.util.*;
import java.util.Map;
import java.util.Set;
import org.apache.commons.math3.linear.*;
import org.apache.lucene.analysis.*;
import org.apache.lucene.document.*;
import org.apache.lucene.index.*;
import org.apache.lucene.store.*;