Skip to content

Instantly share code, notes, and snippets.

View flyingzl's full-sized avatar
🎯
Focusing

石头 flyingzl

🎯
Focusing
  • Chengdu,China
View GitHub Profile
@flyingzl
flyingzl / gist:c587e20bb264c3049546834c5177961a
Created June 17, 2016 10:48 — forked from amitsaxena/gist:9cb0712e572c39a41edc
CustomURL: Launch app if app is installed, else open an alternate URL (Android all browsers)
<script type="text/javascript">
var custom = "myapp://custom_url";
var alt = "http://mywebsite.com/alternate/content";
var g_intent = "intent://scan/#Intent;scheme=zxing;package=com.google.zxing.client.android;end";
var timer;
var heartbeat;
var iframe_timer;
function clearTimers() {
clearTimeout(timer);
@flyingzl
flyingzl / package.json
Last active March 3, 2020 03:29
webpack config configurations on Windows
{
"name": "think-in-react",
"version": "1.0.0",
"description": "",
"main": "app.js",
"scripts": {
"dev": "webpack-dev-server --devtool source-maps --hot --progress --colors --content-base .",
"build": "set NODE_ENV=production&&webpack -pd"
},
"browserify": {
@flyingzl
flyingzl / android_naviator_react-native.js
Last active September 26, 2017 06:32
Use Navigator component in react-native
'use strict';
var React = require('react-native');
var {
AppRegistry,
View,
Navigator,
Text,
BackAndroid,
StyleSheet
@flyingzl
flyingzl / think_in_react.js
Last active October 21, 2015 10:01
Think in React
var App = (props) =>{
return <ProductFilterTable items={props.items} />
}
var ProductFilterTable = React.createClass({
getInitialState: function(){
return {
text: "",
onlyStock:false
@flyingzl
flyingzl / http-sever.go
Created June 10, 2015 07:50
golang server and client
package main
import (
"fmt"
"html/template"
"io"
"log"
"net/http"
"os"
)
//
// API.swift
//
// Created by Taro Minowa on 6/10/14.
// Copyright (c) 2014 Higepon Taro Minowa. All rights reserved.
//
import Foundation
typealias JSONDictionary = Dictionary<String, AnyObject>
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.4'
}
}
apply plugin: 'android'
<script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script type="text/javascript">
if( !Object.create){
Object.create = function( o ){
function actor() {}
actor.prototype = o;
var DeferredHelper = {
objectVariableIsSet: function(object, variableName) {
var dfd = $.Deferred();
var interval = setInterval(function() {
if (object[variableName] !== undefined) {
clearInterval(interval);
console.log('objectVariableIsSet');
dfd.resolve()
}
<style type="text/css">
#container { border: 1px solid #000; }
#left { background: #ccc; width: 300px; float: left; height:200px; }
#right { background: #ddd; width: 300px; float: right; height:200px;}
/* self clearing rules ie8以上及其firefox、chrome等浏览器支持 */