Skip to content

Instantly share code, notes, and snippets.

@fhefh2015
fhefh2015 / alfred.md
Created July 26, 2018 00:49
Alfred 每次开机运行后都提示是否允许访问通讯录

在终端输入:

sudo codesign -f -d -s - /Applications/Alfred\ 3.app/Contents/Frameworks/Alfred\ Framework.framework/Versions/A/Alfred\ Framework
@fhefh2015
fhefh2015 / url.js
Created July 17, 2018 09:08
获取URL参数
//正则方法
function getQueryString(name) {
var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
var r = window.location.search.substr(1).match(reg);
if (r != null) {
return unescape(r[2]);
}
return null;
}
@fhefh2015
fhefh2015 / v.php
Last active January 19, 2025 13:41
抖音无水印下载地址
<?php
/**
* Created by PhpStorm.
* User: aric
* Date: 18/7/10 上午9:34
*/
//获取重定向最终网址
function get_redirect_final_target($url)
{
@fhefh2015
fhefh2015 / html5-video-play-file-blob.html
Created July 5, 2018 14:51 — forked from edin-m/html5-video-play-file-blob.html
HTML video play file blob object url
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<video></video>
<br/>
<input type="file" name="file" id="fileItem" onchange="onChange()" >
@fhefh2015
fhefh2015 / h5_vide.html
Created June 20, 2018 06:06
微信H5视频播放问题解决
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<meta name="viewport" content="target-densitydpi=device-dpi,width=640,user-scalable=no"/>
<style>
html {
-webkit-text-size-adjust: none;
-webkit-user-select: none;
@fhefh2015
fhefh2015 / git.md
Created May 27, 2018 15:01 — forked from suziewong/git.md
Git的多账号如何处理? 1.同一台电脑多个git(不同网站的)账号 2.同一台电脑多个git(同一个网站的比如github的)多个账号

1.同一台电脑可以有2个git账号(不同网站的)

首先不同网站,当然可以使用同一个邮箱,比如我的github,gitlab,bitbucket的账号都是monkeysuzie[at]gmail.com 这时候不用担心密钥的问题,因为这些网站push pull 认证的唯一性的是邮箱 比如我的windows 上 2个账号一个gitlab 一个github (用的都是id_rsa)

host github
  hostname github.com
  Port 22

host gitlab.zjut.com

@fhefh2015
fhefh2015 / tree.php
Created May 25, 2018 07:34
PHP无限级分类实现
<?php
/**
* Created by PhpStorm.
* User: qishou
* Date: 15-8-2
* Time: 上午12:00
* CopyFrom: https://blog.csdn.net/qishouzhang/article/details/47204359
*/
//准备数组,代替从数据库中检索出的数据(共有三个必须字段id,name,pid)
header("content-type:text/html;charset=utf-8");
@fhefh2015
fhefh2015 / http-redirect-target.php
Created April 28, 2018 08:00
Get HTTP redirect destination for a URL in PHP
<?php
// FOLLOW A SINGLE REDIRECT:
// This makes a single request and reads the "Location" header to determine the
// destination. It doesn't check if that location is valid or not.
function get_redirect_target($url)
{
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_NOBODY, 1);
@fhefh2015
fhefh2015 / get_crx.js
Last active April 11, 2018 16:42
下载谷歌插件
function n(e) {
var o = document.createElement("a");
if (o.href = e,
"chrome.google.com" == o.host) {
var n = o.pathname;
"/" == n.slice(-1) && (n = n.slice(0, -1));
var t = n.split("/");
return t.pop()
}
}
@fhefh2015
fhefh2015 / short_url_id.php
Last active April 9, 2018 01:33
短网址ID生成
<?php
/**
* Created by PhpStorm.
* User: fhefh
* Date: 18/4/8
* Time: 下午11:37
*/
function code62($x)
{
$show = '';