Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Liqiang Lau liuliqiang

🎯
Focusing
Block or report user

Report or block liuliqiang

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Free O'Reilly Books.md

Free O'Reilly books and convenient script to just download them.

Thanks /u/FallenAege/ and /u/ShPavel/ from this Reddit post

How to use:

  1. Take the download.sh file and put it into a directory where you want the files to be saved.
  2. cd into the directory and make sure that it has executable permissions (chmod +x download.sh should do it)
  3. Run ./download.sh and wee there it goes. Also if you do not want all the files, just simply comment the ones you do not want.
View authors_books.sql
-- SQL for the Authors & Books tables
BEGIN TRANSACTION;
DROP TABLE IF EXISTS Books;
DROP TABLE IF EXISTS Authors;
CREATE TABLE Authors(AuthorId INTEGER PRIMARY KEY, Name TEXT);
INSERT INTO Authors VALUES(1, 'Jane Austen');
INSERT INTO Authors VALUES(2, 'Leo Tolstoy');
INSERT INTO Authors VALUES(3, 'Joseph Heller');
@liuliqiang
liuliqiang / keyboard4_4.py
Last active Sep 15, 2016
Raspberry 4*4 keyboard code
View keyboard4_4.py
# #####################################################
# Python Library for 4x4 matrix keypad using
# 7 of the avialable GPIO pins on the Raspberry Pi.
#
# This could easily be expanded to handle a 4x4 but I
# don't have one for testing. The KEYPAD constant
# would need to be updated. Also the setting/checking
# of the colVal part would need to be expanded to
# handle the extra column.
#
@liuliqiang
liuliqiang / array.py
Last active Sep 9, 2016
python toml examples
View array.py
import json
import toml
result = toml.loads("""
[array]
hello=['a', 'b', 'c']
arrya_with_array=[
['1', '2', '3'],
['4', '5', '6']
]
@liuliqiang
liuliqiang / app.py
Last active Sep 9, 2016
flask-issue-2016-test
View app.py
#!/usr/bin/env python
# encoding: utf-8
import os.path as op
from flask import Flask, request, render_template
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
You can’t perform that action at this time.