Skip to content

Instantly share code, notes, and snippets.

View madcoda's full-sized avatar

Jason Leung madcoda

  • Madcoda
  • Hong Kong
View GitHub Profile
@steipete
steipete / ios-xcode-device-support.sh
Last active December 12, 2023 03:36
Using iOS 15 devices with Xcode 12.5 (instead of Xcode 13)
# The trick is to link the DeviceSupport folder from the beta to the stable version.
# sudo needed if you run the Mac App Store version. Always download the dmg instead... you'll thank me later :)
# Support iOS 15 devices (Xcode 13.0) with Xcode 12.5:
sudo ln -s /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/15.0 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport
# Then restart Xcode and reconnect your devices. You will need to do that for every beta of future iOS versions
# (A similar approach works for older versions too, just change the version number after DeviceSupport)
@loo2k
loo2k / wechat-browser-detect.js
Last active March 14, 2019 02:08
JavaScript 判断是否微信内置浏览器
var isWeixin = false;
if (typeof WeixinJSBridge == "object" && typeof WeixinJSBridge.invoke == "function") {
isWeixin = true;
} else {
if (document.addEventListener) {
document.addEventListener("WeixinJSBridgeReady", function() { isWeixin = true; }, false);
} else if (document.attachEvent) {
document.attachEvent("WeixinJSBridgeReady", function() { isWeixin = true; });
document.attachEvent("onWeixinJSBridgeReady", function() { isWeixin = true; });
@six0h
six0h / post-update
Created February 26, 2014 17:12
Git Post-Update hook that checks for changes to composer.lock, and fires a composer install if required.
#!/usr/bin/env python
#-*- coding: utf-8 -*-
"""A post-update Git hook to execute `composer install` when composer.json changes
:Author: Cody Halovich
:Company: HootSuite Media Inc.
"""
import subprocess
@nclzz
nclzz / mixpanel-delete-people.py
Last active November 16, 2020 03:03
Run this script to delete all People data in a Mixpanel project. Thanks to the Mixpanel support team for providing me this solution.
#! /usr/bin/env python
import hashlib
import urllib
import time
try:
import simplejson as json
except ImportError:
import json
from pprint import pprint
@claviska
claviska / pretty-buttons.less
Last active October 21, 2022 22:25
A Less mixin' for pretty buttons with Bootstrap 3
.pretty-buttons(@color, @background, @text-shadow: none) {
color: @color;
#gradient > .vertical(lighten(@background, 5%), darken(@background, 5%), 0%, 100%);
border-color: darken(@background, 10%);
border-bottom-color: darken(@background, 20%);
text-shadow: @text-shadow;
.box-shadow(inset 0 1px 0 rgba(255, 255, 255, .1));
&:hover,