Skip to content

Instantly share code, notes, and snippets.

View iflamed's full-sized avatar

New Bing iflamed

View GitHub Profile
@iflamed
iflamed / .bash_profile
Created September 20, 2015 14:59
Gulp notify-send not found
# ssh 到服务器使用gulp watch 出现的notify 错误 可以使用环境变量关闭
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
export DISABLE_NOTIFIER=true
@iflamed
iflamed / full_chain.pem
Last active November 3, 2015 06:10
A ssl example file, which get a grade A+
-----BEGIN CERTIFICATE-----
MIIGCDCCA/CgAwIBAgIQKy5u6tl1NmwUim7bo3yMBzANBgkqhkiG9w0BAQwFADCB
hTELMAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4G
A1UEBxMHU2FsZm9yZDEaMBgGA1UEChMRQ09NT0RPIENBIExpbWl0ZWQxKzApBgNV
BAMTIkNPTU9ETyBSU0EgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMTQwMjEy
MDAwMDAwWhcNMjkwMjExMjM1OTU5WjCBkDELMAkGA1UEBhMCR0IxGzAZBgNVBAgT
EkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UEChMR
Q09NT0RPIENBIExpbWl0ZWQxNjA0BgNVBAMTLUNPTU9ETyBSU0EgRG9tYWluIFZh
bGlkYXRpb24gU2VjdXJlIFNlcnZlciBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEP
ADCCAQoCggEBAI7CAhnhoFmk6zg1jSz9AdDTScBkxwtiBUUWOqigwAwCfx3M28Sh
@iflamed
iflamed / mysql-grant-remote-access.sql
Created December 5, 2015 08:46 — forked from trapp/mysql-grant-remote-access.sql
mysql grant remote access
-- Don't forget to replace »password« with a strong password.
create user 'username'@'localhost' identified by 'password';
grant all privileges on *.* to 'username'@'yourip' IDENTIFIED BY 'password' with grant option;
flush privileges;
@iflamed
iflamed / index.html
Created April 25, 2016 03:03
Sticky footer layout
<body>
<header>...</header>
<section class="main-content">...</section>
<footer>...</footer>
</body>
@iflamed
iflamed / android.js
Created May 5, 2016 15:38
SPA单页面应用在切换hash的时候,往往要更改页面标题,一般是通过document.title来设置。 但是iOS 或者微信里面是有坑的,需要hack 一下
// eg.1
document.title='new title'
//eg.2
document.getElementsByTagName('title')[0].innerHTML = 'new title'
//这个方式 只能够在android 下面生效
@iflamed
iflamed / installAndroidSDKOnMac.md
Created August 26, 2016 11:44 — forked from Erichain/installAndroidSDKOnMac.md
Mac OS下安装和配置android-sdk

##MAC OS下安装和配置android-sdk

###安装

在MAC上安装android-sdk,标准的安装方法是使用homebrew,运行如下命令:

brew update

brew install android-sdk

@iflamed
iflamed / android.txt
Created August 26, 2016 11:45
Android 应用包获取签名
因为 Android 的开放性, 可能是出于安全考虑, 微信 SDK 除了核对应用包名外, 还会核对应用签名, 所以调试 Android 时, 需要保证应用签名与提交审核的签名一致.
首先, 应用务必要通过审核. 至于审核后修改签名是否立即生效, 我没有做验证.
获得最终可用的应用签名的前提是, 应用是以自己的生成的 keystore 签名的, 所以第一个问题应该是, 如何生成自己的 keystore.
JDK 有一个叫 keytool 的工具可以做这个, 一般情况下既然 Cordova 能正常用, 默认 JDK 已经加入 PATH 了, 那么可以直接运行下面的命令.
keytool -genkey -alias [别名] -keyalg RSA -validity 20000 -keystore [文件名.keystore]
别名要记下来, 之后会用到.
@iflamed
iflamed / MentionBlot.js
Created March 12, 2017 16:26
Quilljs MentionBlot
var Base = Quill.import('blots/embed');
/**
* This custom type of Blot is used to represent a Mention.
* It stores 2 values, a Name and an ID.
* The Name is used as a text to display within the input.
*/
class MentionBlot extends Base {
static create(data) {
@iflamed
iflamed / squarebox.css
Created April 2, 2017 03:29
纯css实现正方形框,通过变形:after伪元素的margin-top 的值还可以实现其它比例的高度。
.responsive-bg {
display: block;
width: 100%;
background-color: #fff;
background-position: center;
background-size: cover;
background-repeat: no-repeat;
overflow: hidden;
}
.responsive-bg:after {
@iflamed
iflamed / ssl.conf
Last active April 8, 2017 06:22
The letsencrypt nginx config and issue shell script
server {
listen 443 http2 ssl;
server_name example.com www.example.com;
ssl_certificate /home/user/.acme.sh/example.com_ecc/fullchain.cer;
ssl_certificate_key /home/user/.acme.sh/example.com_ecc/example.com.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_stapling on;
ssl_stapling_verify on;