Skip to content

Instantly share code, notes, and snippets.

View Leeiio's full-sized avatar
💭
Lost in 127.0.0.1

瓜牛 Leeiio

💭
Lost in 127.0.0.1
View GitHub Profile
@huacnlee
huacnlee / yupoo_backup.rb
Created January 28, 2011 07:37
Yupoo 图片备份工具
# coding: UTF-8
#
# Yupoo 照片备份工具
# 此工具不需要API,直接就能备份你的照片信息,下载后以图片 + 一个文本文件的方式存放
# 备份包括内容:
# 原图,标题,说明,Tag,当然有 Exif 信息
#
# Jason Lee <huacnlee@gmail.com>
# http://huacnlee.com
# 2011-01-28
@juliocesar
juliocesar / best-localStorage-polyfill-evar.js
Created April 18, 2011 23:19
This is the best localStorage polyfill in the world
// I mean, seriously, localStorage is supported even by your mum. How about instead of
// casing the feature out, you give users in-memory (stale) storage instead?
// If they close your application, they deserve to lose data anyway.
// if (!('localStorage' in window)) {
if (!Modernizr.localstorage) {
window.localStorage = {
_data : {},
setItem : function(id, val) { return this._data[id] = String(val); },
getItem : function(id) { return this._data.hasOwnProperty(id) ? this._data[id] : undefined; },
@sofish
sofish / textStorage.js
Created September 16, 2011 03:13
Cross-browser TextStorage Solution
/**
* @ NAME: Cross-browser TextStorage
* @ DESC: text storage solution for your pages
* @ COPY: sofish, http://sofish.de
*/
typeof window.localStorage == 'undefined' && ~function () {
var localStorage = window.localStorage = {},
prefix = 'data-userdata',
doc = document,
@disinfeqt
disinfeqt / gist:1319014
Created October 27, 2011 07:58
Twitter bust
<script>
function bust () {
document.write = "";
window.top.location = window.self.location;
setTimeout(function() {
document.body.innerHTML = '';
}, 0);
window.self.onload = function(evt) {
document.body.innerHTML = '';
};
@Leeiio
Leeiio / gist:2863452
Created June 3, 2012 13:18 — forked from zythum/gist:2848881
google收录的敏感词
@paulgibbs
paulgibbs / gist:3199341
Created July 29, 2012 14:46
Web Notifications POC
// very rough, basic javascript calls to use the W3 Web Notifications api, rather than all the webkitNotifications stuff which you find in google.
(function($) {
$(document).ready(function() {
// Ask for permission
$('#ask_permission').click(function(e) {
e.preventDefault();
// webkitNotifications.requestPermission(function(){}); // use this for safari / w3 standards
// window.Notification.requestPermission(function(e) { alert(e); }); // use this for chrome (w3 standard causes a crash)
@typeofweb
typeofweb / webNotification.js
Last active October 7, 2015 21:08
Web Notifications
var showNotification = function (data) {
if (window.webkitNotifications) {
if (!webkitNotifications.checkPermission()) {
var notif = webkitNotifications.createNotification(data.icon, data.title, data.body);
notif.show();
} else {
webkitNotifications.requestPermission(function () {
showNotification(data);
});
}
@janlay
janlay / whitelist.pac
Last active February 29, 2024 20:23
A white-list based PAC.
/*
* A white-list based PAC without regexp, by @janlay
* It's just simple and fast.
* Last update: Oct 20, 2015
* Special thanks to @Paveo
*/
function FindProxyForURL(url, host) {
// REPLACE PROXY WITH YOUR OWN'S
var PROXY = "SOCKS 127.0.0.1:8801;SOCKS5 127.0.0.1:8801;PROXY 127.0.0.1:8800";
var BLACKHOLE = "127.0.0.2";
@zvving
zvving / CLLocation+Sino.h
Last active January 9, 2019 02:39
火星坐标系转换扩展。Earth(国外 WGS84), mars(国内 GCJ-02), bearPaw(百度 BD-09) 坐标系间相互转换
//
// CLLocation+Sino.h
//
// Created by i0xbean@gmail.com on 13-4-26.
// 火星坐标系转换扩展
//
// earth(国外 WGS84), mars(国内 GCJ-02), bearPaw(百度 BD-09) 坐标系间相互转换
// 未包含 mars2earth. 需要这个可参考 http://xcodev.com/131.html
#import <CoreLocation/CoreLocation.h>
@janlay
janlay / README.md
Last active May 11, 2024 03:22
Yet another config for Surge.app

Install

  1. Modify index.txt with your output path and proxy info
  2. Use Text Builder to build configuration for Surge: $ text-builder -index /path/to/index.txt Or run $ sh build-all to build all your index files.
  3. Import configuration via AirDrop/iTunes/Dropbox/iCloud

本人不提供任何保证和技术支持,使用者自负风险。
There are no guarantees, no any support. Use it at your own risk.