Skip to content

Instantly share code, notes, and snippets.

View blahgeek's full-sized avatar
👨‍💻

Yikai Zhao blahgeek

👨‍💻
View GitHub Profile
// ==UserScript==
// @name QiXinHelper
// @namespace http://blahgeek.com/
// @version 0.1
// @description try to take over the world!
// @author BlahGeek
// @match https://www.qixin.com/company/*
// @grant none
// ==/UserScript==
scriptencoding utf-8
set shell=/bin/bash
call plug#begin('~/.config/nvim/plugged')
" Project Management {{{
" localvimrc plugin needs to be at first
let g:localvimrc_ask = 1
let g:localvimrc_sandbox = 1
let g:localvimrc_persistent = 1
#include <glm/glm.hpp>
int g(glm::vec3 x) {
glm::vec3 xx = x + x;
return xx.y;
}
@blahgeek
blahgeek / himawari.py
Last active July 17, 2016 13:29 — forked from willwhitney/himawari.py
Fetch and untile tiled Himawari-8 images from the http://himawari8.nict.go.jp PNG endpoint, then set them as desktop background on OSX
import os
import requests
from datetime import datetime, timedelta
from PIL import Image
from io import BytesIO
import logging
import argparse
TILE_SIZE = 550
@blahgeek
blahgeek / gist:774599fc810dea3bf6ac
Created March 10, 2016 02:12
Stop Safari hanging when selecting the address bar or opening a new tab
This shit has been bugging me for too long, so I went on a hunt and found a workaround.
The Symptoms are as follows:
* Clicking the address bar results in a 1-4 second delay
* Opening links in new tabs results in a 1-4 second delay
* +T results in a 1-4 second delay
* `PressAndHold[<pid>]: IMKServer Stall detected` is present in `/var/log/system.log` at the time of the hang.
It appears to be to do with the PressAndHold helper - the thing that shows an IOS style selection of accents when you hold a key down.
The fix may have some unwanted effects, I haven't really noticed any.

Keybase proof

I hereby claim:

  • I am blahgeek on github.
  • I am blahgeek (https://keybase.io/blahgeek) on keybase.
  • I have a public key whose fingerprint is A74A F69A 8CC3 B7F2 28FA 3074 6D7E C222 C6DE 82BF

To claim this, I am signing this object:

@blahgeek
blahgeek / quine-with-comments.bf
Last active September 12, 2022 08:30
Brainfuck quine
# Run `cat quine.bf | sed 's/#.*//' | tr '\n' ' ' | sed 's/ //g'` to remove comments
# Character map (according to frequency):
# + > < [ ] - .
# 1 2 3 4 5 6 7
# 43 62 60 91 93 45 46
# start
>>>
# data
$ curl -v -6 https://www.google.com
* Rebuilt URL to: https://www.google.com/
* Hostname was NOT found in DNS cache
* Trying 2404:6800:4005:804::1011...
* Connected to www.google.com (2404:6800:4005:804::1011) port 443 (#0)
* successfully set certificate verify locations:
* CAfile: /etc/ssl/certs/ca-certificates.crt
CApath: none
* SSLv3, TLS handshake, Client hello (1):
* SSLv3, TLS handshake, Server hello (2):
Mac OS X 2L~ATTR**com.apple.metadata:kMDItemIsScreenCapture23,com.apple.metadata:kMDItemScreenCaptureTypeecom.apple.quarantinebplist00 bplist00Yselectioq/0042;52d0b1c6;Preview;
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Created by i@BlahGeek.com at 2014-01-01
def pi_generate():
"""
returns a single digit of pi each time iterated
"""
q, r, t, k, m, x = 1, 0, 1, 1, 3, 3
while True: