Skip to content

Instantly share code, notes, and snippets.

翁治平 gocreating

  • Taiwan
Block or report user

Report or block gocreating

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View tile
import React, { Component } from 'react'
class Tile extends Component {
render() {
const { type, colors } = this.props
switch (type) {
case '1':
return (
<div style={{
width: 0,
gocreating / my-model.js
Created Sep 20, 2018 — forked from pulkitsinghal/my-model.js
Non-Static (instance) remote methods for loopback
View my-model.js
var loopback = require('loopback');
// HINT(s):
// Getting the app object:
// From a model script:
module.exports = function(StoreModel) {
StoreModel.prototype.instanceRemoteMethodSignature = function(cb) {
console.log('print this instance object: ', this);
# coding=UTF-8
# Usage:
# python [end_record]
# python [start_record] [end_record]
import sys
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
gocreating / gist:b391b81e65698b7223ce78a1cb9f3cd1
Created Oct 23, 2016 — forked from lttlrck/gist:9628955
rename git branch locally and remotely
View gist:b391b81e65698b7223ce78a1cb9f3cd1
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
# coding=UTF-8
import sys
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
mpl.rcParams['agg.path.chunksize'] = 10000
import _mysql
import time
View example.js
// Usage
var _r = new DollarRecognizer();
if (_points.length >= 10) {
var isUseProtractor = false;
var result = _r.Recognize(_points, isUseProtractor);
console.log("Result: " + result.Name + " (" + round(result.Score,2) + ").");
} else {
console.log("Too few points made. Please try again.");
View boot.js
import React from 'react';
import Router from 'react-router';
import routes from '../routes';, Router.HistoryLocation, (Handler) => {
React.render(<Handler />, document.getElementById('react-container'));
class SubnetForm(forms.Form):
# ...略
def int_to_human(address):
# ...略
return ".".join(str(int(part.ljust(8, "0"), 2)) for part in parts)
def get_network_information(self):
return ({
"address": self.int_to_human(address),
View .js
// flux.js
var Alt = require('alt');
export default class Flux extends Alt {
constructor() {
this.addActions('ActionCreators', require('./actions/TodoActions'));
this.addStore('TodoStore', require('./stores/TodoStore'));
You can’t perform that action at this time.