Skip to content

Instantly share code, notes, and snippets.

View laike9m's full-sized avatar
🧠
🐍

laike9m laike9m

🧠
🐍
View GitHub Profile
@haosdent
haosdent / x_layout.keylayout
Last active April 1, 2024 03:14
Mac OS X Keyboard layout file, works in 10.11
<?xml version="1.1" encoding="UTF-8"?>
<!DOCTYPE keyboard SYSTEM "file://localhost/System/Library/DTDs/KeyboardLayout.dtd">
<!--
Data generated Wed Mar 23 01:35:41 2022
Generated by kluchrtoxml_64 build 203
-->
<!--Last edited by Ukelele version 351 on 2022-03-23 at 01:45 (GMT+8)-->
@takluyver
takluyver / gist:26fb3b7e365dce527886
Created April 19, 2015 23:32
Pycon videos by views
Results of running this script: https://gist.github.com/jabbalaci/398429347c96e98aba88
Views Ups Downs Title (Speakers)
9,810 166 3 Keynote - Jacob Kaplan-Moss - Pycon 2015 (Jacob Kaplan-Moss)
7,044 64 0 Type Hints - Guido van Rossum - PyCon 2015 (Guido van Rossum)
4,742 121 0 David Beazley - Python Concurrency From the Ground Up: LIVE! - PyCon 2015 (David Beazley)
4,684 66 3 Keynote - Guido van Rossum - PyCon 2015 (Guido van Rossum)
4,272 78 1 Dan Callahan - My Python's a little Rust-y - PyCon 2015 (Dan Callahan)
2,694 34 0 How to build a brain with Python (Trevor Bekolay)
2,391 29 0 Andrew T. Baker - Demystifying Docker - PyCon 2015 (Andrew T. Baker)
@jabbalaci
jabbalaci / pyvideo_popularity.py
Created April 19, 2015 11:10
pyvideo popularity
#!/usr/bin/env python3
# encoding: utf-8
"""
I saw a similar script on the homepage of Miguel Grinberg (the Flask book guy),
but he was using webscraping. Here I use simple API calls instead.
The script takes the presentations of a Python conference and orders the
presentations in descending order by the number of youtube views. It
is an indicator about the popularity of a video.
@GiaoGiaoCat
GiaoGiaoCat / wechat-useragent.js
Created March 6, 2015 03:59
微信内置浏览器UserAgent的判断
// 检测浏览器的 User Agent 应该是非常简单的事情
// 微信在 Android 下的 User Agent
mozilla/5.0 (linux; u; android 4.1.2; zh-cn; mi-one plus build/jzo54k) applewebkit/534.30 (khtml, like gecko) version/4.0 mobile safari/534.30 micromessenger/5.0.1.352
// 微信在 iPhone 下的 User Agent
mozilla/5.0 (iphone; cpu iphone os 5_1_1 like mac os x) applewebkit/534.46 (khtml, like gecko) mobile/9b206 micromessenger/5.0
// 通过javascript判断
// 很容易看出来,微信的 User Agent 都有‘micromessenger’字符串标示,我们判断是否含有这些字符串就OK了
function isWeixinBrowser(){
@denji
denji / golang-tls.md
Last active March 29, 2024 03:03 — forked from spikebike/client.go
Simple Golang HTTPS/TLS Examples

Moved to git repository: https://github.com/denji/golang-tls

Generate private key (.key)
# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048

# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)
@leftclickben
leftclickben / gist:322b7a3042cbe97ed2af
Last active June 7, 2023 10:58
Steps to migrate from SVN to GitLab

Steps to migrate from SVN to GitLab

This process worked for me. I take no responsibility for any damage or loss incurred as a result of following or not following these steps or, for that matter, anything else you might do or not do.

Setup

  • SVN is hosted at svn.domain.com.au.
  • SVN is accessible via http (other protocols should work).
  • GitLab is hosted at git.domain.com.au and:
@rothgar
rothgar / install-tmux
Last active April 5, 2023 06:53 — forked from ekiara/how_to_install_tmux_on_centos
Install tmux 1.9 on rhel/centos 6
# Install tmux on Centos release 6.5
# install deps
yum install gcc kernel-devel make ncurses-devel
# DOWNLOAD SOURCES FOR LIBEVENT AND MAKE AND INSTALL
curl -OL https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz
tar -xvzf libevent-2.0.21-stable.tar.gz
cd libevent-2.0.21-stable
./configure --prefix=/usr/local
@thirtythreeforty
thirtythreeforty / tcphole.py
Last active August 29, 2015 14:00
A TCP hole puncher
#!/usr/bin/python3
# tcphole.py
# By George Hilliard ("thirtythreeforty")
# A simple TCP hole puncher for a firewall accepting only ESTABLISHED,RELATED packets
# This currently binds to the localhost address, although that's easy to fix by changing
# the bind() calls.
# This is based on the theory found at http://www.bford.info/pub/net/p2pnat/index.html#sec-tcp.
# You may use this software under the terms of the Creative Commons CC-0 license.
@nickloewen
nickloewen / bret_victor-reading_list.md
Last active March 7, 2024 18:14
Bret Victor’s Reading List

This is a plain-text version of Bret Victor’s reading list. It was requested by hf on Hacker News.


Highly recommended things!

This is my five-star list. These are my favorite things in all the world.

A few of these works have had an extraordinary effect on my life or way of thinking. They get a sixth star. ★

@subfuzion
subfuzion / redis-autostart-osx.md
Last active November 18, 2023 08:20
redis auto start OS X

Install with Homebrew

brew install redis

Set up launchctl to auto start redis

$ ln -sfv /usr/local/opt/redis/*.plist ~/Library/LaunchAgents

/usr/local/opt/redis/ is a symlink to /usr/local/Cellar/redis/x.y.z (e.g., 2.8.7)