Skip to content

Instantly share code, notes, and snippets.

View hitrust's full-sized avatar

hitrust hitrust

View GitHub Profile
// XPath CheatSheet
// To test XPath in your Chrome Debugger: $x('/html/body')
// http://www.jittuu.com/2012/2/14/Testing-XPath-In-Chrome/
// 0. XPath Examples.
// More: http://xpath.alephzarro.com/content/cheatsheet.html
'//hr[@class="edge" and position()=1]' // every first hr of 'edge' class
@hitrust
hitrust / boto3
Created May 8, 2020 00:31
boto3 example
1.boto3 type
Python 3.5.2 (default, Nov 12 2018, 13:43:14)
>>> from boto3.dynamodb.types import Binary
>>> b = Binary(b'hello')
>>> b
Binary(b'hello')
>>> print(b.value)
b'hello'
@hitrust
hitrust / curl.md
Created December 20, 2019 02:11 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

" Make IE Better Compatible "
<!--[if IE]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
======================================================
IE6 Only
==================
_selector {...}
@hitrust
hitrust / install_python_36_amazon_linux.sh
Created October 2, 2018 12:13 — forked from niranjv/install_python_36_amazon_linux.sh
Install Python 3.6 in Amazon Linux
# A virtualenv running Python3.6 on Amazon Linux/EC2 (approximately) simulates the Python 3.6 Docker container used by Lambda
# and can be used for developing/testing Python 3.6 Lambda functions
# This script installs Python 3.6 on an EC2 instance running Amazon Linux and creates a virtualenv running this version of Python
# This is required because Amazon Linux does not come with Python 3.6 pre-installed
# and several packages available in Amazon Linux are not available in the Lambda Python 3.6 runtime
# The script has been tested successfully on a t2.micro EC2 instance (Root device type: ebs; Virtualization type: hvm)
# running Amazon Linux AMI 2017.03.0 (HVM), SSD Volume Type - ami-c58c1dd3
# and was developed with the help of AWS Support
@hitrust
hitrust / footer.js
Created August 12, 2018 04:06 — forked from daverogers/footer.js
Assign "active" class to navbar item based on current page URL with jQuery
#!/bin/bash
# note: this script is invoked automatically by rackspace-flasky.py
# save command line arguments
GMAIL_USERNAME=$1
GMAIL_PASSWORD=$2
# install web server dependencies
apt-get update
apt-get -y install python python-virtualenv nginx supervisor git
@hitrust
hitrust / common-config.json
Last active November 4, 2017 05:08 — forked from anonymous/config.json
Bootstrap Customizer Config
{
"vars": {
"@gray-base": "#000",
"@gray-darker": "lighten(@gray-base, 13.5%)",
"@gray-dark": "lighten(@gray-base, 20%)",
"@gray": "lighten(@gray-base, 33.5%)",
"@gray-light": "lighten(@gray-base, 46.7%)",
"@gray-lighter": "lighten(@gray-base, 93.5%)",
"@brand-primary": "darken(#428bca, 6.5%)",
"@brand-success": "#5cb85c",
@hitrust
hitrust / htens-config.json
Last active November 4, 2017 05:07 — forked from anonymous/config.json
Bootstrap Customizer Config
{
"vars": {
"@gray-base": "#000",
"@gray-darker": "lighten(@gray-base, 13.5%)",
"@gray-dark": "lighten(@gray-base, 20%)",
"@gray": "lighten(@gray-base, 33.5%)",
"@gray-light": "lighten(@gray-base, 46.7%)",
"@gray-lighter": "lighten(@gray-base, 93.5%)",
"@brand-primary": "darken(#428bca, 6.5%)",
"@brand-success": "#5cb85c",
@hitrust
hitrust / gist:54192e0f76556697404a571532f80460
Last active September 19, 2017 22:45
300 行 python 代码的轻量级 HTTPServer 实现文件上传下载
# !/usr/bin/env python
# coding=utf-8
# http://my.oschina.net/leejun2005/blog/71444
"""
简介这是一个 python 写的轻量级的文件共享服务器基于内置的SimpleHTTPServer模块),
支持文件上传下载只要你安装了python建议版本2.6~2.7不支持3.x),
然后去到想要共享的目录下执行
python SimpleHTTPServerWithUpload.py
或者 python SimpleHTTPServerWithUpload.py filename