Skip to content

Instantly share code, notes, and snippets.

View muyexi's full-sized avatar
😬

Winter muyexi

😬
View GitHub Profile
@muyexi
muyexi / workflow-build.py
Last active June 29, 2024 02:32 — forked from deanishe/workflow-build.py
Build Alfred Workflows into .alfredworkflow (zip) files
#!/usr/bin/python
# encoding: utf-8
#
# Copyright (c) 2013 deanishe@deanishe.net.
#
# MIT Licence. See http://opensource.org/licenses/MIT
#
# Created on 2013-11-01
#
@muyexi
muyexi / binance.ipynb
Last active October 18, 2021 06:19
Binance.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
title theme revealOptions
SwiftLint
solarized
transition
slide

SwiftLint


extension Optional where Wrapped: OptionalString {
var isNilOrEmpty: Bool {
return ((self as? String) ?? "").isEmpty
}
}
@muyexi
muyexi / Implicit-retain-cycle.swift
Last active December 20, 2018 08:00
Implicit retain cycle in lazy var
class API {
var status: String?
var failureHandler: (() -> Void)?
var completionHandler: (() -> Void)?
init() {}
}
class ViewController: UIViewController {
@muyexi
muyexi / disableAppTransportSecurity.sh
Created October 30, 2015 05:12
Bash script to disable App Transport Security in iOS 9
#!/bin/bash
if [[ $1 = "" ]]; then
echo Usage: disableAppTransportSecurity.sh PLIST_PATH
exit 1
fi
#PlistBuddy的位置
PLISTBUDDY="/usr/libexec/PlistBuddy"
- (UIImage *)snapshot {
int webViewHeight = [self stringByEvaluatingJavaScriptFromString:@"document.body.offsetHeight;"].floatValue;
CGFloat pageHeight = self.frame.size.height;
int pageCount = webViewHeight / pageHeight;
if ((webViewHeight % pageCount) > 0) {
pageCount++;
}
for (int i = 0; i < pageCount; i++) {
@muyexi
muyexi / Custom_iOS6_UI
Created November 13, 2014 04:18
Custom iOS6 UI to like iOS7
[[UIBarButtonItem appearance] setBackgroundImage:[UIImage new]
forState:UIControlStateNormal
barMetrics:UIBarMetricsDefault];
[[UINavigationBar appearance] setTitleTextAttributes:@{
NSForegroundColorAttributeName: [UIColor blackColor],
NSFontAttributeName: [UIFont systemFontOfSize:17],
UITextAttributeTextShadowOffset: [NSValue valueWithUIOffset:UIOffsetZero]
}];
@muyexi
muyexi / opml_to_markdown.rb
Last active January 9, 2018 22:15
Convert your feedly OPML file to a markdown file
#Convert your feedly OPML file to a markdown file
#Usage:
#ruby opml_to_markdown.rb FEEDLY_OPML_PATH
require 'nokogiri'
markdownContent = ""
opmlFile = File.open(ARGV[0])
opmlDoc = Nokogiri::XML(opmlFile)
markdownName = opmlDoc.xpath('//head/title').text