Skip to content

Instantly share code, notes, and snippets.

View CicoZhang's full-sized avatar

None CicoZhang

View GitHub Profile
@CicoZhang
CicoZhang / Bash_Script_takes_input.sh
Created July 24, 2018 13:13
Telegram bot as a reminder
#!/bin/bash
message=$1
if [[ -n "$message" ]]; then
curl -s -X POST https://api.telegram.org/bot[Your_API_Key]/sendMessage -d chat_id=[Your_Chat_ID] -d text="$message"
else
curl -s -X POST https://api.telegram.org/bot[Your_API_Key]/sendMessage -d chat_id=[Your_Chat_ID] -d text="The task is finished."
fi
@CicoZhang
CicoZhang / gyndns
Created December 25, 2017 12:10 — forked from pjaton/gyndns
A bash script to update a dynamic DNS entry on Google Domain using their provided API.
#!/bin/bash
#
# Copyright 2015-present Patrice Jaton.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@CicoZhang
CicoZhang / print_matrix_to_file.py
Last active December 10, 2017 14:24
Dynamic Programming
def print_matrix_to_file(matrix, fileName):
"""Write a matrix into file.
matrix: a list of list in Python, storing an alignment or a score
matrix.
fileName: str, a file name (with a path) to store the matrix.
It is not recommended to modify this function.
"""
with open(fileName, 'w') as f:
for row in matrix:
@CicoZhang
CicoZhang / pep8_cheatsheet.py
Created September 11, 2017 18:06 — forked from RichardBronosky/pep8_cheatsheet.py
PEP-8 cheatsheet
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""This module's docstring summary line.
This is a multi-line docstring. Paragraphs are separated with blank lines.
Lines conform to 79-column limit.
Module and packages names should be short, lower_case_with_underscores.
Notice that this in not PEP8-cheatsheet.py
@CicoZhang
CicoZhang / disgenet_wikipathway.rq
Last active December 8, 2016 15:33
SWAT4LS 2016 Hackathon ID-mapping
#Federated Query that runs on Disgenet SPARQL endpoint - http://rdf.disgenet.org/sparql/
#(takes genes associated with Alzheimer’s Disease and returns a list of pathways)
#(current query only has NCBI genes, have to accommodate the IMS to return all potential #alternative URI conventions.)
PREFIX wp: <http://vocabularies.wikipathways.org/wp#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX dcterms: <http://purl.org/dc/terms/>
SELECT DISTINCT ?gene
str(?geneName) as ?name
?score