Skip to content

Instantly share code, notes, and snippets.

View kenshinji's full-sized avatar
🎯
Focusing

Fred Wang kenshinji

🎯
Focusing
View GitHub Profile

Keybase proof

I hereby claim:

  • I am kenshinji on github.
  • I am kenshinji (https://keybase.io/kenshinji) on keybase.
  • I have a public key ASCP7uHcOKzOFZJCjwJsbqPhO4jlZ4-yqa7uGgaUJunpFQo

To claim this, I am signing this object:

@kenshinji
kenshinji / sun-moon-time.js
Last active March 14, 2021 08:47
Scriptable script for getting sunset/sunrise & moonset/moonrise time for your location
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: orange; icon-glyph: magic;
// Script for getting sunset/sunrise & moonset/moonrise time for your location.
const w = new ListWidget()
w.backgroundColor = new Color("#222222")
// apiKey from https://ipgeolocation.io/
const apiKey = ''
@kenshinji
kenshinji / readme.md
Created April 5, 2019 14:22 — forked from YieldNull/readme.md
爬取新浪微博中指定用户所有相册图片,并保存到本地

功能

给定用户的ID(微相册的数字ID,非昵称),下载用户相册中所有图片到本地

所需模块

rsa,threadpool

登陆

请先更改login_weibo中的用户名及密码

用法

const Nightmare = require('nightmare');
const nightmare = Nightmare({show:true});
//nightmare.useragent('Headless')
nightmare.cookies.set({
url: 'https://mastering-phoenix-framework-federicoesparza.c9users.io:8081/',
name: 'c9.live.user.click-through',
value: 'ok',
path: '/',
secure: true,
@kenshinji
kenshinji / flatten.rb
Created September 22, 2017 16:40
flatten an array in ruby
def flattify(array)
array.each_with_object([]) do |element, flattened|
flattened.push *(element.is_a?(Array) ? flattify(element) : element)
end
end