Skip to content

Instantly share code, notes, and snippets.

View greatghoul's full-sized avatar
🏠
Working from home

greatghoul greatghoul

🏠
Working from home
View GitHub Profile
// ==UserScript==
// @name Gitlab Build Trace
// @namespace greatghoul
// @version 0.1
// @description Fix gitlab build trace
// @author greatghoul
// @match https://example.com/*/*/builds/*
// @grant none
// ==/UserScript==
@greatghoul
greatghoul / zh-CN.yml
Created September 7, 2016 07:39 — forked from huacnlee/zh-CN.yml
zh-CN.yml for Mongoid
"zh-CN":
will_paginate:
next_label: "下一页 →"
previous_label: "← 上一页"
page_gap: "…"
mongoid:
models:
user: "用户"
attributes:
user:
@greatghoul
greatghoul / qrcode.js
Created August 25, 2016 12:03 — forked from justan/qrcode.js
a qrcode bookmarklet(二维码小书签)
//a qrcode bookmarklet(二维码小书签)
//javascript:(function(d){var b=d.createElement("textarea"),c,f=!!d.all,a,e="http://qrcode.kaywa.com/img.php?s=5&d=%s";(c=d.getElementById("_qrcode__"))?(b=c,a=b.style,a.display=""):(a=b.style,b.id="_qrcode__",d.body[f?"attachEvent":"addEventListener"]((f?"on":"")+"click",function(){a.display="none"},!0),a.zIndex=9999,a.position="fixed",a.top=0,a.left=0,a.width="100%",a.height="100%",d.body.appendChild(b));c=function(){var a,b=d.selection,c=d.activeElement,e=top.getSelection,f=c&&c.selectionEnd;f?a=c.value.substring(c.selectionStart, f):e&&(a=e()+"");b&&(a=b.createRange().text);return a=a||location.href}();b.title=c;e=e.replace("%s",encodeURIComponent(c));a.color='#fff';a.background="rgba(0, 0, 0, 0.3) url("+e+") no-repeat center";b.select()})(document);
//original code
(function(doc){
var qrcode = doc.createElement('textarea'), tmp,
ie = !!doc.all, style, txt,
qrimage = 'http://qrcode.kaywa.com/img.php?s=5&d=%s',
id = '_qrcode__';
@greatghoul
greatghoul / event.js
Last active March 22, 2016 06:27
an extension tha each time I close a tab a new one open - https://redd.it/49j7h5
const mappings = {};
chrome.tabs.onCreated.addListener((tab) => {
mappings[tab.id] = tab.url;
});
chrome.tabs.onUpdated.addListener((tabId, changeInfo, tab) => {
mappings[tabId] = tab.url;
});
@greatghoul
greatghoul / manifest.json
Created January 16, 2016 13:31
Chrome Manifest File Example
{
"manifest_version": 2,
"name": "Extension Name",
"description": "Extension Description",
"version": "0.1",
"icons": {
"48": "img/icon48.png",
"128": "img/icon128.png"
alert(1);
@greatghoul
greatghoul / check_vpn.py
Last active February 29, 2020 15:48
选择最快的 VPN 服务
#!/usr/bin/env python
"""
A pure python ping implementation using raw socket.
Note that ICMP messages can only be sent from processes running as root.
Derived from ping.c distributed in Linux's netkit. That code is
copyright (c) 1989 by The Regents of the University of California.
That code is in turn derived from code written by Mike Muuss of the
US Army Ballistic Research Laboratory in December, 1983 and
placed in the public domain. They have my thanks.
html, body, p, form, div, table, textarea, input, span, select {
font-size: 24px;
line-height: 1.5em;
}
html {
background-color: #2A2727;
}
body {
@greatghoul
greatghoul / 10-tips-for-remote-working.md
Last active November 12, 2018 01:33
提升在家上班工作效率10秘诀

在超级飓风桑迪过后,龟速的通勤使纽约区上班族把家居环境变成临时办公室: 坐在沙发开会,透过Skype交易,以及在iPhone上看报表。

根据Telework网路调查,大约300万美国人在家工作。 尤其值此纽约区域雇主和员工必须共体时艰的当下,在家工作人数将持续增加。

然而,如何提升在家工作的效率?以及如何确保在没有办公室的情况下, 利用熟练的电讯沟通技巧让生意能正常运作?这些都是在家工作者最大的挑战, 为此,《华尔街日报》近期整理出以下几个秘诀,希望能提高远距离工作者的效率:

@greatghoul
greatghoul / Makefile
Created February 6, 2015 15:11
SAE Python Webapp Makefile
#!/bin/bash
PKG_FILE=site/site-packages.zip
install:
@echo '-- Install development dependencies'
pip install -r requirements-dev.txt
@echo '-- Install runtime dependencies'
saecloud install -r requirements.txt
@echo '-- Package dependencies to site/site-packages.zip'