Skip to content

Instantly share code, notes, and snippets.

View peterlee0127's full-sized avatar

PeterLee peterlee0127

View GitHub Profile
[{
"displayName": "淡江大學",
"link": "www.google.com",
"image":"www.google.png",
"category":"food",
"opentime":"12:00~21:00",
"phone": "0922332542",
"longitude": 34,
"latitude": 121
},
// 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;
//
// 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>
#! /bin/sh
if [ "$1" = "namenode" ]
then
start-dfs.sh
elif [ "$1" = "datanode" ]
then
netstat -na | grep 50010 -q ;
if [ $? -eq 1 ]
then
echo "next"
@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
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 / 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 = {