Skip to content

Instantly share code, notes, and snippets.

View 17's full-sized avatar
🦖

Jase Su 17

🦖
  • Oracle
  • Canton, China
View GitHub Profile
@phith0n
phith0n / README.md
Created July 16, 2019 08:51
跑一跑微博被和谐的图

跑一跑微博被和谐的图

sinaimg子域名,跑一遍即可。

@undoZen
undoZen / production.js
Created March 27, 2019 05:49
Taro webpack h5 build hash all assets
module.exports = {
h5: {
miniCssExtractPluginOption: {
filename: 'css/[name].[hash].css',
chunkFilename: 'css/[id].[chunkhash].css'
},
enableDll: false,
webpackChain(chain, webpack) {
const hashRule = (type) => {
chain.module.rules.get(type).uses.get("urlLoader").get("options").name =
@7sDream
7sDream / togif.sh
Created March 6, 2019 09:50
togif.sh
#!/bin/bash
if [ "$#" -lt 2 ]; then
echo "Usage: $0 videofile output fps width start duration"
exit 1
fi
VIDEO=$1
OUTPUT=$2
FPS=$3
@beginor
beginor / snowflake-id.sql
Last active November 20, 2024 09:41
Twitter Snowflake ID for PostgreSQL
CREATE SEQUENCE public.global_id_seq;
ALTER SEQUENCE public.global_id_seq OWNER TO postgres;
CREATE OR REPLACE FUNCTION public.id_generator()
RETURNS bigint
LANGUAGE 'plpgsql'
AS $BODY$
DECLARE
our_epoch bigint := 1314220021721;
seq_id bigint;
@hirejordansmith
hirejordansmith / magnific-popup-gallery-image-plus-video.js
Last active February 5, 2025 08:47
How to show images and video in Magnific Popup Gallery
@moneytoo
moneytoo / gist:ab3f34e4fddc2110675952f8280f49c5
Last active March 22, 2020 16:05
nginx with OpenSSL 1.0.2 (ALPN) on CentOS 7, also available from https://brouken.com/brouken-centos-7-repo/
### No longer needed as of nginx-1.13.6-1.el7_4.ngx.x86_64.rpm from nginx.org
### it was compiled against OpenSSL 1.0.2 from CentoOS 7.4 so it supports ALPN (HTTP2 works)
yum -y groupinstall 'Development Tools'
yum -y install wget openssl-devel libxml2-devel libxslt-devel gd-devel perl-ExtUtils-Embed GeoIP-devel rpmdevtools
OPENSSL="openssl-1.0.2l"
NGINX_VERSION="1.13.5-1"
NJS_VERSION="1.13.5.0.1.13-1"
@elvisw
elvisw / mirrorlist.mingw32
Last active January 20, 2022 22:43
MSYS2国内源
##
## 32-bit Mingw-w64 repository mirrorlist
## Changed on 2014-11-15
##
##中国科学技术大学开源软件镜像
Server = http://mirrors.ustc.edu.cn/msys2/mingw/i686
##北京理工大学镜像
Server = http://mirror.bit.edu.cn/msys2/REPOS/MINGW/i686
##日本北陆先端科学技术大学院大学 sourceforge 镜像
Server = http://jaist.dl.sourceforge.net/project/msys2/REPOS/MINGW/i686
@laomo
laomo / fetion.py
Created May 21, 2014 09:18
一个利用飞信给自己发消息的脚本
#-*-coding: utf-8 -*-
#!/usr/bin/python
import requests
def sendMsg(msg):
url_space_login = 'http://f.10086.cn/huc/user/space/login.do?m=submit&fr=space'
url_login = 'http://f.10086.cn/im/login/cklogin.action'
url_sendmsg = 'http://f.10086.cn/im/user/sendMsgToMyselfs.action'
parameter= { 'mobilenum':'yourmobile', 'password':'yourpassword'}
@derek
derek / gist:8035740
Last active April 30, 2018 04:01
Boyer–Moore–Horspool in JavaScript
function boyer_moore_horspool(haystack, needle) {
var badMatchTable = {};
var maxOffset = haystack.length - needle.length;
var offset = 0;
var last = needle.length - 1;
var scan;
// Generate the bad match table, which is the location of offsets
// to jump forward when a comparison fails
Array.prototype.forEach.call(needle, function (char, i) {
@joncave
joncave / endpoints.php
Created June 7, 2012 19:41
WP_Rewrite endpoints demo
<?php
/*
Plugin Name: WP_Rewrite endpoints demo
Description: A plugin giving example usage of the WP_Rewrite endpoint API
Plugin URI: http://make.wordpress.org/plugins/2012/06/07/rewrite-endpoints-api/
Author: Jon Cave
Author URI: http://joncave.co.uk/
*/
function makeplugins_endpoints_add_endpoint() {