Skip to content

Instantly share code, notes, and snippets.

View huzemin's full-sized avatar
🐱
CAONIMA

胡泽民 huzemin

🐱
CAONIMA
  • HuiZhou University
  • HuiZhou ,China
View GitHub Profile
@wangwen1220
wangwen1220 / js-setcookie.js
Last active December 24, 2018 11:20
js: 原生 JavaScript 设置 cookie 值 | setCookie
// 原生 JavaScript 设置 cookie 值
function setCookie(name, value, time) {
var now = new Date();
var offset = 8;
var utc = now.getTime() + (now.getTimezoneOffset() * 60000);
var nd = utc + (3600000 * offset);
var exp = new Date(nd);
var domain = document.domain;
exp.setTime(exp.getTime() + time * 60 * 60 * 1000);
document.cookie = name + "=" + escape(value) + ";path=/;expires=" + exp.toGMTString() + ";domain=" + domain + ";"
@ionauq
ionauq / PhpStorm Keymap
Last active June 22, 2021 02:42
PhpStorm快捷键
### Editing ###
`Ctrl + Space` 基本代码完成(任意类的,方法的或者变量的名称)
`Ctrl + Shift + Enter` 补全当前语句
`Ctrl + P` Parameter info (within method call arguments)
`Ctrl + Q` 快速查找文档
`Ctrl + 鼠标滑过` 简明信息查看
`Ctrl + F1` 在插入符号处显示错误或者警告信息
`Alt + Insert` 生成代码...(Getters,Setters,Constructors)
`Ctrl + O` 重写方法
`Ctrl + I` 实现方法
<?php
/**
* 使用openssl进行加密解密范例
* @author 胡泽民<[email protected]>
*/
$data = "Hello world";
// 加密
$public_pem_str = file_get_contents("./openssl_key/public.pem");
$public_key = openssl_pkey_get_public($public_key_str);