Skip to content

Instantly share code, notes, and snippets.

@timwis
timwis / ratchetscrollfix.css
Created January 8, 2013 19:20
Ratchet/junior leverages `-webkit-overflow-scrolling` but seems to have a bug on Safari Mobile when you drag the header and then try to scroll the body. This CSS reverts to standard scrolling with a fixed-position header.
/* Fix scrolling */
body, .content, #app-container { position: static; } /* #app-container is for junior */
.content { -webkit-overflow-scrolling: auto; }
header + .content { padding-top: 44px; }
header + .content-padded { padding-top: 55px; }
.bar-title .title + [class*="button"]:last-child { top: 5px; } /* From ratchet.css, overridden by junior.css */
@mopsled
mopsled / utilities.h
Last active December 11, 2015 14:48
Drop-in fopen replacement for iOS applications that prepends the documents directory to file paths.
//
// utilities.h
//
#include <stdio.h>
#ifndef MyProject_utilities_h
#define MyProject_utilities_h
FILE *iosfopen(const char *filename, const char *mode);
@lucifr
lucifr / private.xml
Created February 17, 2013 16:00
My KeyRemap4MacBook private.xml
<?xml version="1.0"?>
<root>
<item>
<name>F19 to F19</name>
<appendix>(F19 to Hyper (ctrl+shift+cmd+opt) + F19 Only, F19)</appendix>
<identifier>private.f192f19</identifier>
<autogen>
--KeyOverlaidModifier--
KeyCode::F19,
KeyCode::COMMAND_L,
@Kingson
Kingson / Douban_movie_query.py
Last active June 16, 2020 07:42
豆瓣电影查询助手V3.0 #增加给新关注的用户自动返回“欢迎关注豆瓣电影,输入电影名称即可快速查询电影讯息哦!”信息的功能 #大力丰富注释和docstring信息,以帮助后来者能快速上手。
#! /usr/bin/env python
# coding=utf-8
__author__ = 'jszhou'
from bottle import *
import hashlib
import xml.etree.ElementTree as ET
import urllib2
# import requests
import json
#!/bin/bash
## Mini-Xcode: XCode 5
MIN_VERSION="6.0"
# set default output folder is build
OUTPUT_FOLDER=${PREFIX-build}
# set default compiler
CC=${CC-$(xcrun --find gcc)}
@wgbartley
wgbartley / proxy.php
Last active December 18, 2017 16:30
Spark PHP Proxy
<?php
// Set your access token here
define('ACCESS_TOKEN', 'your_access_token_here');
// Make sure we have an HTTP_ACCEPT header,
// and if so, make it lower-case for easier string matching
if(isset($_SERVER['HTTP_ACCEPT']))
$_SERVER['HTTP_ACCEPT'] = strtolower($_SERVER['HTTP_ACCEPT']);
else
@sj26
sj26 / using-brew-versions.sh
Created July 18, 2014 03:01
Install old formula versions with homebrew
~$ cd $(brew --prefix)
/usr/local$ brew versions openssl
Warning: brew-versions is unsupported and may be removed soon.
Please use the homebrew-versions tap instead:
https://github.com/Homebrew/homebrew-versions
1.0.1h git checkout 7541601 Library/Formula/openssl.rb
1.0.1g git checkout db3123d Library/Formula/openssl.rb
1.0.1f git checkout 0b515fb Library/Formula/openssl.rb
1.0.1e git checkout 3c62281 Library/Formula/openssl.rb
@guileen
guileen / p2pclient.go
Last active September 3, 2019 07:31
Go P2P Demo
// golang p2p udp client
package main
import (
"fmt"
"net"
"log"
"encoding/binary"
"encoding/hex"
@jason5ng32
jason5ng32 / surge.conf
Last active November 6, 2024 06:39
Surge Configs ( for 2.x )
[General]
loglevel = notify
skip-proxy = 127.0.0.1, 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12, 100.64.0.0/10, localhost, *.local, ::ffff:0:0:0:0/1, ::ffff:128:0:0:0/1
bypass-tun = 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12
# dns-server = 119.29.29.29,223.5.5.5,114.114.115.115
# external-controller-access = [email protected]:6155
# ipv6 = true
// REMEMBER TO CHANGE THE external-controller-access' PASSWORD
@ufologist
ufologist / autoplay-audio-ios.html
Created December 3, 2015 03:55
在 iOS 微信浏览器中自动播放 HTML5 audio(音乐) 的正确方式
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<title>Auto play html audio in iOS WeChat InAppBrowser the right way</title>
</head>
<body>
<h1>在 iOS 微信浏览器中自动播放 HTML5 audio(音乐) 的正确方式</h1>
<p>核心原理: 在微信的JS-API 中 play 一下 audio 即可达到自动播放的目的(应该是微信自己做了处理)</p>