Skip to content

Instantly share code, notes, and snippets.

View 123Daoxyz's full-sized avatar

Daoxyz 123Daoxyz

  • null
  • LA@USA
View GitHub Profile
'use strict';
const puppeteer = require('puppeteer');
(async () => {
/* PRECONDITION:
0. download ublock, I used https://github.com/gorhill/uBlock/releases/download/1.14.19b5/uBlock0.chromium.zip
1. run $PATH_TO_CHROME --user-data-dir=/some/empty/directory --load-extension=/location/of/ublock
2. enable block lists you want to use
*/
@TimothyYe
TimothyYe / bench.sh
Created October 24, 2017 01:52
Bench test script
#!/usr/bin/env bash
#
# Description: Auto test download & I/O speed script
#
# Copyright (C) 2015 - 2016 Teddysun <[email protected]>
#
# Thanks: LookBack <[email protected]>
#
# URL: https://teddysun.com/444.html
#
@pixeline
pixeline / php_upgrade_to_71.sh
Last active March 16, 2023 16:49
Update Mac Os X's php version to php 7.1 using homebrew. Includes curl and mcrypt
# 1. Install brew --> http://brew.sh/
# 2. run the following commands in your Terminal
brew tap homebrew/dupes
brew tap homebrew/versions
brew tap homebrew/homebrew-php
brew install --with-openssl curl
brew install --with-homebrew-curl --with-apache php71
brew install php71-mcrypt php71-imagick
# 3. Follow these instructions to make Apache and php-cli use the newer php executable and make the change persist after reboot.
brew info php71
@abhishekbhardwaj
abhishekbhardwaj / php71.sh
Created January 15, 2017 03:00
Install PHP7.1 on OSX with Homebrew
brew update
brew upgrade
brew tap homebrew/dupes
brew tap homebrew/versions
brew tap homebrew/homebrew-php
brew install php71
## To use PHP7.1 on CLI, add this to .bash_profile
@VitoVan
VitoVan / youdao-fanyi.el
Last active September 21, 2017 06:23
有道翻译 Emacs 快捷方式 C-c C-f
(defvar base-youdao-url "http://fanyi.youdao.com/openapi.do?keyfrom=emacs-yd-pub&key=527593631&type=data&doctype=json&version=1.1&q=")
;; Get yourself an API KEY here: http://fanyi.youdao.com/openapi?path=data-mode
(defun youdao-fanyi ()
"Translate current word (en->cn, cn->en), prompt to input if no word here"
(interactive)
(let* ((word (or (thing-at-point 'word) (read-string "Translate> ")))
(full-url (concat base-youdao-url word)))
(with-current-buffer (url-retrieve-synchronously full-url)
(unwind-protect
(progn
@nicnocquee
nicnocquee / buildstaticlib.sh
Created January 20, 2016 20:22
Script to create fat static library for iOS
#!/bin/bash
# This script is based on https://gist.github.com/rehos/7856163
if [ -z "$1" ]; then
echo
echo "usage: $0 <project.xcodeproj> [<scheme>]"
echo
exit
fi
@santoshachari
santoshachari / nginx.default.conf
Last active February 22, 2022 22:11 — forked from sumardi/nginx.default.conf
PHP5.6 and NGINX: Install PHP56-FPM, Nginx & MySQL on EC2 with Amazon Linux AMI
# Install linux update, followed by GCC and Make
sudo yum -y update
sudo yum install -y gcc make
# Install Nginx and php56-FPM
sudo yum install -y nginx php56-fpm
# Install php56 extensions
sudo yum install -y php56-devel php-mysql php56-pdo php56-pear php56-mbstring php56-cli php56-odbc php56-imap php56-gd php56-xml php56-soap
@jvmsangkal
jvmsangkal / connection-pool.py
Created October 21, 2015 03:36
Connection Pool PyMySQL
class ConnectionPool():
"""
Usage:
conn_pool = nmi_mysql.ConnectionPool(config)
db = conn_pool.get_connection()
db.query('SELECT 1', [])
conn_pool.return_connection(db)
conn_pool.close()
@nickbayley
nickbayley / alt-ssh-copy-id.md
Last active September 5, 2024 12:09
Simple Alternative to ssh-copy-id

Simple Alternative to ssh-copy-id

Replace user with the name of the user you want to ssh as.

Replace the ip with the ip of the machine / host / vps you want to connect to.

cat ~/.ssh/id_rsa.pub | ssh user@ip "cat >> ~/.ssh/authorized_keys"
@songron
songron / weibo_login_with_cookie.py
Created December 18, 2014 14:25
Simulate Weibo Login