Skip to content

Instantly share code, notes, and snippets.

View gonejack's full-sized avatar
💭
I may be slow to respond.

会有猫的 gonejack

💭
I may be slow to respond.
View GitHub Profile
@gdianaty
gdianaty / cmakejs.cmake
Last active February 23, 2024 04:32
CMake.js Inclusion Function for ordinary CMake
# Authored by Graham Dianaty for Bitlogix Technologies. Based on code from Rene Hollander. ==========//
function(setup_cmakejs)
find_program(CMAKEJS "cmake-js")
find_program(NPM "npm")
# first, check if we have NPM:
if(NPM)
message(VERBOSE "NPM found.")
else()
message(FATAL_ERROR "NPM not found. This project requires Node.js")
endif()
@javilobo8
javilobo8 / download-file.js
Last active April 9, 2024 12:01
Download files with AJAX (axios)
axios({
url: 'http://localhost:5000/static/example.pdf',
method: 'GET',
responseType: 'blob', // important
}).then((response) => {
const url = window.URL.createObjectURL(new Blob([response.data]));
const link = document.createElement('a');
link.href = url;
link.setAttribute('download', 'file.pdf');
document.body.appendChild(link);
@usunyu
usunyu / gbk-unzip.py
Created October 24, 2016 09:42
解决unzip中文乱码问题
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# unzip-gbk.py
import os
import sys
import zipfile
print "Processing File " + sys.argv[1]
Install Homebrew OS X package manager:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Install ffmpeg with x265 support:
brew install ffmpeg --with-fdk-aac --with-ffplay --with-freetype --with-libass --with-libquvi --with-libvorbis --with-libvpx --with-opus --with-x265
Convert video to x265:
ffmpeg -i input -c:v libx265 -preset medium -crf 28 -c:a aac -b:a 128k output.mp4
Uninstall ffmpeg:
@oliyh
oliyh / image-url-to-data-uri.js
Created November 7, 2015 22:17
Convert an image url to a data URI without canvas
// hard won knowledge from http://stackoverflow.com/questions/20035615/using-raw-image-data-from-ajax-request-for-data-uri
var xmlHTTP = xhr.XMLHttpRequest();
xmlHTTP.open('GET', url, true);
xmlHTTP.responseType = 'arraybuffer';
xmlHTTP.onload = function(e) {
var arr = new Uint8Array(this.response);
var raw = String.fromCharCode.apply(null,arr);
var b64 = base64.encode(raw);
var dataURL="data:image/png;base64," + b64;
};
@oropesa
oropesa / Ignore .idea from git
Last active October 1, 2019 10:43
Ignore .idea folder from git in PHPStorm
1. Make PHPStorm ignore .idea folder
|- File > Settings > Version Control > Ignored Files > Add(+) > Ignored all files under > select directory .idea
2. Clean PhpStorm Git Cache
|- Open Terminal (Left+Down) #> "C:\Program Files (x86)\Git\cmd\git.exe" rm -f --cached .idea/*
or
|- Open Terminal (Left+Down) #> git rm -f --cached .idea/*
3. Reboot PhpStorm
\- Done!
@xhacker
xhacker / emoji.plist
Last active October 26, 2023 15:59
/System/Library/LinguisticData/RequiredAssets_zh.bundle/AssetData/emoji.plist in OS X 10.11 Copyright (C) Apple Inc.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>0</key>
<dict>
<key>emoji</key>
<array>
<string>0⃣️</string>
</array>
@v5tech
v5tech / ffmpeg.md
Last active January 16, 2024 09:19
ffmpeg视频合并、格式转换、截图

使用ffmpeg合并MP4文件

ffmpeg -i "Apache Sqoop Tutorial Part 1.mp4" -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate1.ts
ffmpeg -i "Apache Sqoop Tutorial Part 2.mp4" -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate2.ts
ffmpeg -i "Apache Sqoop Tutorial Part 3.mp4" -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate3.ts
ffmpeg -i "Apache Sqoop Tutorial Part 4.mp4" -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate4.ts
ffmpeg -i "concat:intermediate1.ts|intermediate2.ts|intermediate3.ts|intermediate4.ts" -c copy -bsf:a aac_adtstoasc "Apache Sqoop Tutorial.mp4"
@messense
messense / shadowsocks-on-openwrt.md
Last active June 8, 2023 07:49
shadowsocks on openwrt

配置 shadowsocks

架设好 shadowsocks 服务端,在路由器上安装 shadowsocks 客户端,并配置 /etc/config/shadowsocks.json ,假设本地监听端口为 1080 。启动 shadowsocks

/etc/init.d/shadowsocks start

配置 privoxy

安装 privoxy openwrt 版。

@ninehills
ninehills / wr703n-openwrt.md
Last active December 9, 2022 13:37
WR703N OpenWrt 配置流程

WR703N OpenWrt 配置流程

下载安装

访问WR703N在OpenWrt的[Wiki页][wr703n-openwrt],然后在Flashing一节中找到下载链接:[squashfs-factory.bin][flash.bin],下载后别忘了[比对md5][md5sum]。[1]

进入路由器管理界面,出厂配置为http://192.168.1.1,用户名和密码均为admin,然后进入固件更新,选择下载的文件,然后更新。