Skip to content

Instantly share code, notes, and snippets.

View agrcrobles's full-sized avatar

Garcia agrcrobles

  • Barcelona
View GitHub Profile
.service('AdminPlantsDevicesCtrlInit', [
// Dependencias
'$q',
'$route',
'Plant',
'Notify',
function($q, $route, Plant, Notify) {
return {
prepare: function() {
var
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Echk.Web.Mvc
{
/// <summary>
/// ale's approach
/// </summary>
import React from "react";
import { withRouter } from "react-router";
class Test extends React.Component {
constructor(props) {
super(props);
this.state = {
};
}
componentWillReceiveProps(nextProps) {
type Size = 1 | 2 | 3;
const GetSize = (): Size => {
const result: number = parseInt(Math.random() * 20);
if (result > 3) {
return 3;
}
return result;
};
package com.hellohybrid;
/**
* Created by zetta on 2/1/17.
*/
import com.facebook.react.bridge.NativeModule;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContext;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
package com.hellohybrid;
/**
* Created by zetta on 2/1/17.
*/
import com.facebook.react.bridge.NativeModule;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.ReactPackage;
export const GoogleApi = function(opts) {
opts = opts || {}
const apiKey = opts.apiKey;
const libraries = opts.libraries || [];
const client = opts.client;
const URL = 'https://maps.googleapis.com/maps/api/js';
const googleVersion = '3.22';
let script = null;
@agrcrobles
agrcrobles / redux-light-example.js
Created September 10, 2017 19:20 — forked from bloodyowl/redux-light-example.js
redux in 14 lines of code
const store = createStore((state = { counter: 0 }, action) => {
switch(action.type) {
case "INCREMENT":
return { counter: state.counter + 1 }
case "DECREMENT":
return { counter: state.counter - 1 }
default:
return state
}
})
@agrcrobles
agrcrobles / blockchain.py
Created October 4, 2017 11:06 — forked from dvf/blockchain.py
Blockchain: Step 2
block = {
'index': 1,
'timestamp': 1506057125.900785,
'transactions': [
{
'sender': "8527147fe1f5426f9dd545de4b27ee00",
'recipient': "a77f5cdfa2934df3954a5c7c7da5df1f",
'amount': 5,
}
],
@agrcrobles
agrcrobles / React Native: Animated - Code
Created October 5, 2017 16:01 — forked from sahrens/React Native: Animated - Code
Example code from ReactEurope 2015 talk - React Native: Animated
/**
* The examples provided by Facebook are for non-commercial testing and
* evaluation purposes only.
*
* Facebook reserves all rights not expressly granted.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL
* FACEBOOK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN