Skip to content

Instantly share code, notes, and snippets.

View lincerely's full-sized avatar
🕹️

Lincerely lincerely

🕹️
View GitHub Profile
@lincerely
lincerely / index.html
Last active September 1, 2016 10:07
download file from link with "a" 's download tag
<head>
<meta charset="UTF-8">
<title>Download from link</title>
</head>
<body>
<h1>Please use Chrome or Opera</h1>
<h2>cross origin download is not allow in Firefox,<br> so it will open the file in your broswer.</h2>
<input id="link" type="text" />
<a id="button" download>Download</a>
{
"result":[
{
"id":"1",
"name":"belal",
"email":"belal@mail.com"
},
{
"id":"3",
"name":"sunny",
@lincerely
lincerely / midterm_note.md
Last active October 14, 2016 05:28
CS4295 Mobile app midterm note
@lincerely
lincerely / q-learning.py
Last active April 25, 2018 16:09
Implemented the example from A painless Q-Learning Tutorial http://mnemstudio.org/path-finding-q-learning-tutorial.htm and visualized
#!/usr/bin/env python
#http://mnemstudio.org/path-finding-q-learning-tutorial.htm
#tested on python and python3
import numpy as np
import os
R = np.array([[-1, -1, -1, -1, 0, -1],
[-1, -1, -1, 0, -1, 100],
[-1, -1, -1, 0, -1, -1],
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters
from spell import *
updater = Updater(token="")
dispatcher = updater.dispatcher
import logging
logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
level=logging.INFO)
@lincerely
lincerely / GameManager.cs
Last active May 19, 2017 18:46
Unity Singleton GameManager
using UnityEngine;
using System.Collections;
public class GameManager : MonoBehaviour {
public static GameManager manager; //singleton
void Awake(){
if(manager == null){
DontDestroyOnLoad(gameObject);
@lincerely
lincerely / nginx.conf
Last active May 31, 2017 11:50 — forked from atma/nginx.conf
Nginx + nodejs + socket.io websockets with index.html on root
# Add to nginx.conf http section
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
@lincerely
lincerely / setTime.sh
Created August 31, 2017 03:22
Set time to Hong Kong Observatory standard time
sudo ntpdate -u stdtime.gov.hk
@lincerely
lincerely / WebSocket-temp-logger.md
Last active March 24, 2021 02:01
Logging raspberry pi temperature with Websocketd and Smoothie Charts

Install websocketd

wget https://github.com/joewalnes/websocketd/releases/download/v0.2.12/websocketd-0.2.12-linux_arm.zip
unzip websocketd-0.2.12-linux_arm.zip

Listen at port 8080

@lincerely
lincerely / .gitignore
Created October 21, 2017 10:53
My Unity .gitignore
# ===========================
# Default Collab Ignore Rules
# ===========================
# OS Generated
# ============
.DS_Store
._*
.Spotlight-V100
.Trashes