Skip to content

Instantly share code, notes, and snippets.

View samma835's full-sized avatar

samma samma835

  • Shanghai
View GitHub Profile
@samma835
samma835 / WebCacheCleaner.swift
Created June 26, 2019 05:46 — forked from insidegui/WebCacheCleaner.swift
Clear WKWebView's cookies and website data storage, very useful during development.
import Foundation
import WebKit
final class WebCacheCleaner {
class func clean() {
HTTPCookieStorage.shared.removeCookies(since: Date.distantPast)
print("[WebCacheCleaner] All cookies deleted")
WKWebsiteDataStore.default().fetchDataRecords(ofTypes: WKWebsiteDataStore.allWebsiteDataTypes()) { records in
@samma835
samma835 / sketch-never-ending.md
Created June 13, 2017 07:03 — forked from Bhavdip/sketch-never-ending.md
Modify Sketch to never ending trial

###Sketch trial non stop

Open hosts files:

$ open /private/etc/hosts

Edit the file adding:

127.0.0.1 backend.bohemiancoding.com

127.0.0.1 bohemiancoding.sketch.analytics.s3-website-us-east-1.amazonaws.com

var nightCss = 'html,body,div,span,applet,object,'
+ 'h1,h2,h3,h4,h5,h6,p,blockquote,'
+ 'pre,abbr,acronym,address,big,cite,'
+ 'code,del,dfn,em,font,img,ins,kbd,'
+ 'q,s,samp,small,strike,strong,sub,'
+ 'sup,tt,var,b,u,i,center,dl,dt,dd,'
+ 'ol,ul,li,fieldset,form,label,'
+ 'legend,table,caption,tbody,tfoot,thead,th,td'
+ '{background:#333333 !important;'
+ 'color:#A0A0A0 !important;'
@samma835
samma835 / search_domain.py
Created November 27, 2012 01:01 — forked from lintianzhi/search_domain.py
search availible domain name
#!/usr/bin/python
#coding=utf-8
import urllib
import urllib2
import re
import threading
import Queue
url = 'https://who.is/whois/name_search/'