Skip to content

Instantly share code, notes, and snippets.

@tslmy
tslmy / scrollbar_example.css
Last active January 6, 2022 12:45 — forked from tpitale/scrollbar_example.css
Supports horizontal scrollbar now. I removed the scrollbar buttons.
::-webkit-scrollbar {
width: 5px;
height:5px;
}
::-webkit-scrollbar-thumb {
background-color: #999;
border-radius: 5px;
}
@tslmy
tslmy / index.html
Last active December 17, 2015 14:49
Browser ============ _A browser inside your browser._ Just a demo of tabbed multi-iframes.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>虹忆轩浏览器 Beta</title>
<meta name="description" content="A web browser in a web page." />
<meta name="keywords" content="browser,tslmy,lino,personal,website,student,geek,otaku,名扬剑仙" />
<!-- favicon start -->
<link href="/favicon.ico" rel="icon" type="image/x-icon" />
@tslmy
tslmy / index.html
Created May 22, 2013 12:28
Search Bar in Pure CSS ============= This is just a small search bar, styled just like the one on your Finder. It turned out that using this CSS code to draw a search bar is more traffic-consuming than just using a `background-image: url(Search_Bar.png)`. So, I suggest, use this only when you want to show off your Geekiness.
<html>
<head>
<style type="text/css">
<!--
#searchbox {
height:20px;
width:152px;
background:rgba(0,0,0,0);
border:1px solid grey;
border-radius: 10px;
@tslmy
tslmy / javascript_resources.md
Created April 9, 2016 20:23 — forked from jookyboi/javascript_resources.md
Here are a set of libraries, plugins and guides which may be useful to your Javascript coding.

Libraries

  • jQuery - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
  • Backbone - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
  • AngularJS - Conventions based MVC framework for HTML5 apps.
  • Underscore - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
  • lawnchair - Key/value store adapter for indexdb, localStorage
@tslmy
tslmy / python_resources.md
Created April 9, 2016 20:23 — forked from jookyboi/python_resources.md
Python-related modules and guides.

Packages

  • lxml - Pythonic binding for the C libraries libxml2 and libxslt.
  • boto - Python interface to Amazon Web Services
  • Django - Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.
  • Fabric - Library and command-line tool for streamlining the use of SSH for application deployment or systems administration task.
  • PyMongo - Tools for working with MongoDB, and is the recommended way to work with MongoDB from Python.
  • Celery - Task queue to distribute work across threads or machines.
  • pytz - pytz brings the Olson tz database into Python. This library allows accurate and cross platform timezone calculations using Python 2.4 or higher.

Guides

@tslmy
tslmy / css_resources.md
Created April 9, 2016 20:23 — forked from jookyboi/css_resources.md
CSS libraries and guides to bring some order to the chaos.

Libraries

  • 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
  • Compass - Open source CSS Authoring Framework.
  • Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
  • Font Awesome - The iconic font designed for Bootstrap.
  • Zurb Foundation - Framework for writing responsive web sites.
  • SASS - CSS extension language which allows variables, mixins and rules nesting.
  • Skeleton - Boilerplate for responsive, mobile-friendly development.

Guides

@tslmy
tslmy / Bullseye.js
Last active July 9, 2016 14:15 — forked from ttscoff/Bullseye.bookmarklet
A bookmarklet for grabbing just a piece of a web page and converting it to Markdown using heckyesmarkdown.com.
// version 0.5
// Uses nvALT.
// Not using remote/external loading because it is often blocked by allowed-origin.
// Now serves under HTTPS.
// version 0.4
// Bugfix for Firefox
//
// Bullseye 0.3
// Add escape key to cancel
@tslmy
tslmy / main.py
Created July 14, 2016 15:03
Save multiple webpages in individual Markdown files
import requests, re
with open('url.txt','r') as URLlist:
for url in URLlist:
r = requests.get('http://heckyesmarkdown.com/go/?read=1&preview=0&showframe=0&u='+url)
lines = r.text.split('\n')
title = ''
for line in lines:
if line.startswith('# '):
title = line[2:]
break
@tslmy
tslmy / Zimm–Bragg.py
Created August 3, 2016 14:23
Zimm–Bragg Model calculator
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''Zimm–Bragg Model calculator'''
import itertools
LENGTH =9
def weight(weight_sigma = 0, weight_s = 0):
if weight_sigma == 0 and weight_s == 0:
return '1'
elif weight_sigma == 0:
@tslmy
tslmy / main.py
Created August 9, 2017 09:20
Find Meaning for Phone Number
numToLetter = {"1": ("_"),
"2": ("A", "B", "C"),
"3": ("D", "E", "F"),
"4": ("G", "H", "I"),
"5": ("J", "K", "L"),
"6": ("M", "N", "O"),
"7": ("P", "Q", "R", "S"),
"8": ("T", "U", "V"),
"9": ("W", "X", "Y", "Z"),
"0": ("+")}