Skip to content

Instantly share code, notes, and snippets.

- (UIViewController *)formViewController {
id responder = self;
while (responder) {
if ([responder isKindOfClass:[UIViewController class]]){
return responder;
}
responder = [responder nextResponder];
}
return nil;
}
@Qgap
Qgap / qqmusic.py
Created April 27, 2018 10:51
qq music download
import re
import json
import time
import random
import requests
import urllib
import time
import codecs
@Qgap
Qgap / music download.py
Created April 26, 2018 10:35
python for neteasy music
#!/usr/local/bin/python3
# -*- coding: UTF-8 -*-
import requests
import urllib
import json
userAgent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/604.5.6 (KHTML, like Gecko) Version/11.0.3 Safari/604.5.6'
# 有的网站为了防攻击,采用了判断请求来源
r = requests.get('http://music.163.com/api/playlist/detail?id=84051656',headers={'User-Agent':userAgent})
array = r.json()['result']['tracks']
@Qgap
Qgap / YourViewController.m
Created October 12, 2016 09:20 — forked from amster/YourViewController.m
Load a UIWebView in iOS that can also load local resources like images, CSS, and JavaScript
// An example viewDidLoad
- (void)viewDidLoad
{
[super viewDidLoad];
[self loadWebView];
}
// The example loader
//
// Assumes you have an IBOutlet for the UIWebView defined: @property (strong, nonatomic) UIWebView *wv;
@Qgap
Qgap / WhyRSS
Created November 21, 2015 15:23 — forked from callmewhy/WhyRSS
我的RSS订阅,主要是iOS博客
<?xml version="1.0" encoding="UTF-8"?>
<opml version="1.0">
<head>
<title>Subscriptions - WHY</title>
</head>
<body>
<outline text="cool" title="cool">
<outline htmlUrl="http://kedebug.com/" title="kedebug" xmlUrl="http://kedebug.com/atom.xml" type="rss" text="kedebug"/>
<outline htmlUrl="http://lucida.me/" title="Lucida" xmlUrl="http://lucida.me/atom.xml" type="rss" text="Lucida"/>
<outline htmlUrl="http://www.wbrecom.com" title="微博推荐" xmlUrl="http://www.wbrecom.com/?feed=rss2" type="rss" text="微博推荐"/>