Skip to content

Instantly share code, notes, and snippets.

View genffy's full-sized avatar
♥️
peace

Zhengfei Li genffy

♥️
peace
View GitHub Profile
@genffy
genffy / remove-gray.js
Last active December 3, 2022 06:43
remove-gray PR wellcome
// ==UserScript==
// @name remove-gray
// @namespace http://tampermonkey.net/
// @version 0.1
// @description remove gray theme
// @author You
// @match *://*/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=tampermonkey.net
// @grant GM_addStyle
// ==/UserScript==
@genffy
genffy / how-to-force-a-file-download-with-ningx.md
Created November 21, 2016 00:44 — forked from nepsilon/how-to-force-a-file-download-with-ningx.md
How to force a file download with Nginx? — First published in fullweb.io issue #73

How to force a file download with Nginx?

In short:

add_header Content-Disposition 'attachment; filename="foo.txt"';

We’re just adding a Content-Disposition header in the response. You can specify the file name, here we’re using foo.txt.

@genffy
genffy / 悦跑圈Api用法.md
Created September 27, 2016 17:22 — forked from kkmike999/悦跑圈Api用法.md
悦跑圈Api代理用法

Http api使用方法

示例代码+解说:

ps.代码仅用于演示,与实际代码出入

json数据

{
    "ret": "0",
    "msg": "成功",
@genffy
genffy / randomStr.js
Last active May 19, 2016 09:09
randomStr
function randomStr(len) {
var str = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789',
strLen = str.length,
arr = [];
while (len > 0) {
var index = Math.random() * strLen,
a = str.slice(index, index + 1);
if (a) {
arr.push(a);
len--;
@genffy
genffy / README.md
Created May 18, 2016 10:38 — forked from addyosmani/README.md
108 byte CSS Layout Debugger

CSS Layout Debugger

A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.

One-line version to paste in your DevTools

Use $$ if your browser aliases it:

~ 108 byte version

@genffy
genffy / DeleteFiles.java
Created April 21, 2016 07:27
rm file for deep path folder, such as npm in windows
import java.io.File;
public class DeleteFiles {
public static void deleteFiles( File file ){
if( file.isDirectory() ){
File[] files = file.listFiles();
if( files.length == 0 ){
file.delete();
} else {
for( File f : files ){
@genffy
genffy / 0_reuse_code.js
Created September 29, 2015 06:11
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console