Skip to content

Instantly share code, notes, and snippets.

View peterlee0127's full-sized avatar

PeterLee peterlee0127

View GitHub Profile
@peterlee0127
peterlee0127 / cloudflare.txt
Last active March 23, 2018 03:29
Cloudflare DDNS node
'use strict';
const getIP = require('external-ip')();
const request = require('request');
const email = 'email';
const key = 'cloudflare-key';
// This program update 'type A record' to 'external IP address' of your domain in cloudflare.
function getDNSInfo(domain) {
var info = {
var phantom = require('phantom');
const fs = require('fs');
const widthTag = 'width=device-width';
const mediaTag = 'media';
//const mediaTag = 'media screen and (';
async function parseSite(url) {
const instance = await phantom.create(['--ignore-ssl-errors=yes']);
const page = await instance.createPage();
@peterlee0127
peterlee0127 / gist:4551897915fc704e25c343bc99cfef00
Created July 26, 2017 12:37
Tensorflow for Nvidia Jetson TX1/TX2
# tensorflow-TX1/TX2
Tensorflow for Nvidia TX1/TX2
## Nvidia TX 1/2 Environment
#### JetPack 3.1
1. cuDNN 6.0
2. CUDA 8.0
3. Python 2.7
Tensorflow 1.3.0rc aarch64
#! /bin/sh
if [ "$1" = "namenode" ]
then
start-dfs.sh
elif [ "$1" = "datanode" ]
then
netstat -na | grep 50010 -q ;
if [ $? -eq 1 ]
then
echo "next"
//
// NetworkModel.m
// TKU-WiFi
//
// Created by Peterlee on 7/26/14.
// Copyright (c) 2014 Peterlee. All rights reserved.
//
#import "NetworkModel.h"
#import <SystemConfiguration/SystemConfiguration.h>
// Slide to unlock Animation
CALayer *maskLayer = [CALayer layer];
maskLayer.backgroundColor = [[UIColor colorWithRed:0.0f green:0.0f blue:0.0f alpha:0.55f] CGColor];
maskLayer.contents = (id)[[UIImage imageNamed:@"mask.png"] CGImage];
maskLayer.contentsGravity = kCAGravityCenter;
maskLayer.frame = CGRectMake(self.frame.size.width * -1, 0.0f, self.frame.size.width * 2, self.frame.size.height);
CABasicAnimation *maskAnim = [CABasicAnimation animationWithKeyPath:@"position.x"];
maskAnim.byValue = [NSNumber numberWithFloat:self.frame.size.width];
maskAnim.repeatCount = HUGE_VAL;
maskAnim.duration = 2.0f;
[{
"displayName": "淡江大學",
"link": "www.google.com",
"image":"www.google.png",
"category":"food",
"opentime":"12:00~21:00",
"phone": "0922332542",
"longitude": 34,
"latitude": 121
},
[modelsArray sortUsingSelector:@selector(myCompareMethodWithDict:)];
@interface GeofenceDataModel(myCompare)
- (NSComparisonResult)myCompareMethodWithDict: (GeofenceDataModel *) model;
@end
#! bin/sh
#淡江大學無線網路登入系統Script 適用Unix,Linux,Mac
#iOS 版本 https://itunes.apple.com/app/id541911220?mt=8
#蘭陽適用
user=帳號 #這裡改成自己的帳號
pass=密碼 #這裡改成自己的密碼
url=http://163.13.30.254/goform/eumLogin? #要POST的位址
#163.13.27~30.254
#! /bin/sh
#淡江大學新版無線網路登入系統Script 適用Unix,Linux,Mac
#iOS 版本 https://itunes.apple.com/app/id541911220?mt=8
#淡水適用
user=帳號 #這裡改成自己的帳號
pass=密碼 #這裡改成自己的密碼
url=http://163.13.246.254/cgi-bin/ace_web_auth.cgi #要POST的位址