Skip to content

Instantly share code, notes, and snippets.

View lvwzhen's full-sized avatar
🎯
Focusing

lvwzhen lvwzhen

🎯
Focusing
View GitHub Profile
@suziewong
suziewong / git.md
Last active September 30, 2024 08:18
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

@hzlzh
hzlzh / function.php
Last active December 14, 2015 09:09
WordPress 自定义添加/删除用户字段
<?php
/* add to functions.php of the theme */
add_filter('user_contactmethods','my_user_contactmethods');
function my_user_contactmethods($user_contactmethods ){
unset($user_contactmethods['aim']);
unset($user_contactmethods['yim']);
unset($user_contactmethods['jabber']);
$user_contactmethods ['weibo'] = '微博URL';
return $user_contactmethods ;
}
@mattheu
mattheu / gist:7127778
Created October 23, 2013 22:18
## Fix login loop. * When WordPress is installed in a subdirectory, wp-admin/ links don't work correctly. We fix this with an nginx rewrite. * But... it appends reauth=1 to the url which forces a reauthentication when submitted... and you have to log in again!
/**
* Fix login loop.
*
* When WordPress is installed in a subdirectory, wp-admin/ links don't work correctly. We fix this with an nginx rewrite.
* But... it appends reauth=1 to the url which forces a reauthentication when submitted... and you have to log in again!
*/
add_filter( 'login_url', function( $url ) {
if ( '/wp-admin/' === add_query_arg( array() ) ) {
@Harryyan
Harryyan / Snapshot
Created April 22, 2014 03:17
使用phantomjs实现网页批量截图,网页url可存在txt文件中
// Render Multiple URLs to image
var RenderUrlsToImage, arrayOfUrls, system;
system = require("system");
var fs = require('fs');
/*
Render given urls
@param array of URLs to render
var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ],

Font Face

A mixin for writing @font-face rules in SASS.

Usage

Create a font face rule. Embedded OpenType, WOFF2, WOFF, TrueType, and SVG files are automatically sourced.

@include font-face(Samplino, fonts/Samplino);
@moehlone
moehlone / make_writable.js
Created March 17, 2016 08:27
Make JavaScript readonly propertys writable (example for overwriting navigator.userAgent; useful for unit tests -> browser detection)
/**
* Creates a read/writable property which returns a function set for write/set (assignment)
* and read/get access on a variable
*
* @param {Any} value initial value of the property
*/
function createProperty(value) {
var _value = value;
/**
@tomasen
tomasen / guide-to-reading-mathematical-expressions-aloud.md
Last active August 8, 2024 13:44
How to Read Mathematical Expressions Out Loud

Basic

Expression How to Read This
$$a + b$$ a plus b
$$a - b$$ a minus b
$$a \times b$$ a times b
$$a / b$$ a over b
$$a &gt; b$$ a is greater than b
$$a &lt; b$$ a is less than b