Skip to content

Instantly share code, notes, and snippets.

@tiptopcoder
tiptopcoder / code.js
Last active October 25, 2022 04:02
Đánh giá môn học - Dùng cho portal của HCMUS - ĐH KHTN TP.HCM
/**
* [...]
* This script is not optimized. It's to kind to tell me if you have any better ideas.
* Script van chua hoan thien. Toi rat cam on neu ban co the cho toi cac y tuong khac
*
* @author Hong Trang D. Nguyen
* @version 1.00
* @since 01/01/2016
* @credits Quy Hoa L. Huynh, Ngoc Tien Nhan
*
@tiptopcoder
tiptopcoder / locating-restriction-sites.py
Last active May 12, 2016 05:39
Locating Restriction Sites Algorithm
# Locating Restriction Sites
# ==========================
#
# A DNA string is a reverse palindrome if it is equal to its reverse complement.
# For instance, GCATGC is a reverse palindrome because its reverse complement is GCATGC.
#
# Given: A DNA string of length at most 1 kbp.
#
# Return: The position and length of every reverse palindrome in the string having length between 4 and 12.
#
@tiptopcoder
tiptopcoder / monoisotopic-mass-table.py
Created May 12, 2016 06:53
Monoisotopic mass table
map = {
"A": 71.03711,
"C": 103.00919,
"D": 115.02694,
"E": 129.04259,
"F": 147.06841,
"G": 57.02146,
"H": 137.05891,
"I": 113.08406,
"K": 128.09496,
@tiptopcoder
tiptopcoder / fibonnaci.cpp
Created May 15, 2016 05:50
Fibonacci using Dynamic Array
#include <stdio.h>
#include <stdlib.h>
int main ()
{
double *fib;
int n, i;
printf("How many periods would you like? ");
scanf("%d", &n );
@tiptopcoder
tiptopcoder / alchemySample.json
Created May 25, 2016 08:45
Alchemy Sample Data - Full application
{
"edges": [
{
"source": "a__GvdCXSG",
"target": "pfDJNfFqZi"
},
{
"source": "NDdqRT4xHo",
"target": "oqFk0F86Wc"
},
##########################################
# To run:
# curl -sSL https://gist.githubusercontent.com/sirkkalap/e87cd580a47b180a7d32/raw/d9c9ebae4f5cf64eed4676e8aedac265b5a51bfa/Install-Docker-on-Linux-Mint.sh | bash -x
##########################################
# Check that HTTPS transport is available to APT
if [ ! -e /usr/lib/apt/methods/https ]; then
sudo apt-get update
sudo apt-get install -y apt-transport-https
fi
@tiptopcoder
tiptopcoder / .block
Last active May 23, 2018 15:57
fresh block
license: mit
@tiptopcoder
tiptopcoder / .block
Last active June 26, 2018 06:20
Tree of Life
license: gpl-3.0
height: 960
@tiptopcoder
tiptopcoder / test.js
Created January 14, 2020 07:14
How good your JS?
function addLinks () {
for (var i=0, link; i<5; i++) {
link = document.createElement("a");
link.innerHTML = "Link " + i;
link.onclick = function () {
alert(i);
};
document.body.appendChild(link);
}
}
import { formatName } from "~/utils/helpers/format-name";
export class User {
get fullName() {
return formatName("John", "Doe");
}
}