Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
Have fun! 🐶

Qing Cai strongwillow

:octocat:
Have fun! 🐶
  • Netherlands
View GitHub Profile
View weather.py
#!/usr/bin/env python3
import requests
r = requests.get('https://api.darksky.net/forecast/9ba42d2d7e496f2fb181e33940faec61/51.419551,5.446345?units=auto')
cur = r.json()['currently']
tmp = cur['temperature']
wind = float(cur['windSpeed'])
print("OUTSIDE TEMP", tmp, "°C WIND", wind, "KMH")
View blocklist.txt
analytics.google.com
google-analytics.com
googlesyndication.com
adservice.google.nl
adservice.google.com
googletagmanager.com
mmstat.com
addthis.com
ads.linkedin.com
doubleclick.net
View predict.py
#!/usr/bin/env python3
import matplotlib
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.colors import ListedColormap
from sklearn import tree
from sklearn.tree import DecisionTreeRegressor
View gist:c696462aea00f9bf21e58c6a6677a12a
(when (>= emacs-major-version 24)
(require 'package)
(add-to-list
'package-archives
'("melpa" . "http://melpa.org/packages/")
t)
(package-initialize))
(require 'org)
@strongwillow
strongwillow / tmux.cheat
Created May 22, 2017 13:00 — forked from afair/tmux.cheat
Tmux Quick Reference & Cheat sheet - 2 column format for less scrolling!
View tmux.cheat
========================================== ==========================================
TMUX COMMAND WINDOW (TAB)
========================================== ==========================================
List tmux ls List ^b w
New -s <session> Create ^b c
Attach att -t <session> Rename ^b , <name>
Rename rename-session -t <old> <new> Last ^b l (lower-L)
Kill kill-session -t <session> Close ^b &
@strongwillow
strongwillow / XmasBreak.md
Last active December 16, 2016 12:46
Gran Canaria & Barcelona 8 Days Holiday
View XmasBreak.md

Wed, 21: Maspalomas

  • Arrive at airport: 10:35
  • 50 mins from airport to Maspalomas
  • Rest in Maspalomas beaches

Thu, 22: Hiking Day

  • from Maspalomas to Roque Nublo, Map
  • Morning: Half day round trip Tripadvisor
@strongwillow
strongwillow / Christmas-Trip.md
Last active November 21, 2016 20:41
trip to Copenhagen and Stockholm
View Christmas-Trip.md

Option 1 (6 days northern):

Eindhoven to Copenhagen:

  • Dates: 23 - 26
  • Flights: €40

Copenhagen to Stockholm:

  • Dates: 26 - 29
  • Flights: €60
@strongwillow
strongwillow / MapKit-autonavi.swift
Last active September 22, 2016 04:41
Test if MapKit is using Apple data or AutoNavi data
View MapKit-autonavi.swift
let geocoder = CLGeocoder()
let appleHQCoord = CLLocation(latitude: 37.331998, longitude: -122.029645)
geocoder.reverseGeocodeLocation(appleHQCoord) { (placemarks, error) in
if (error?.code == 2) {
// using autonavi
}
else {
// using apple map
}
@strongwillow
strongwillow / ViewController.m
Last active August 29, 2016 07:35
BlurringOverlay #ios
View ViewController.m
//
// ViewController.m
// BlurringOverlay
//
// Created by 温商贷 on 8/26/16.
// Copyright © 2016 曹航. All rights reserved.
//
#import "ViewController.h"