Skip to content

Instantly share code, notes, and snippets.

View carlosdlf's full-sized avatar

Carlos DLF carlosdlf

View GitHub Profile
@carlosdlf
carlosdlf / index.html
Created April 30, 2015 03:21
Hello World in ReactJs
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>Hello World</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.12.2/react.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.12.2/JSXTransformer.js"></script>
</head>
<body>
<!--<script type="text/jsx">-->
@carlosdlf
carlosdlf / app.js
Created April 30, 2015 03:32
React / renders
/**
* Created by clarico on 29/04/2015.
*/
var App = React.createClass({
render:function(){
return (
<div>
<b>BOLD</b>
<h1>Hola</h1>
</div>
@carlosdlf
carlosdlf / app.js
Created April 30, 2015 03:40
Jugando con propiedads
/**
* Created by clarico on 29/04/2015.
*/
var App = React.createClass({
getDefaultProps: function () { /*defaults*/
return {
txt:'default :D',
cat: 404
}
},
@carlosdlf
carlosdlf / app.js
Created April 30, 2015 03:52
React input text
/**
* Created by clarico on 29/04/2015.
*/
var App;
App = React.createClass({
getInitialState: function () {
return {
txt: "the state txt",
id: 0
}
@carlosdlf
carlosdlf / app.js
Created April 30, 2015 19:47
Widget Basic ReactJs
/**
* Created by clarico on 29/04/2015.
*/
var App = React.createClass({
getInitialState: function () {
return {
txt: ""
}
},
update: function (e) {
@carlosdlf
carlosdlf / app.js
Created April 30, 2015 20:20
REFS -REACT JS
/**
* Created by clarico on 29/04/2015.
*/
var App = React.createClass({
getInitialState: function () {
return {
red : 0,
blue : 0,
green : 0
}
@carlosdlf
carlosdlf / App.js
Created May 1, 2015 00:25
React Children
/**
* Created by clarico on 30/04/2015.
*/
var App = React.createClass({
render:function(){
return <Button>I <Heart/> React</Button>
}
});
var Button = React.createClass({
@carlosdlf
carlosdlf / App.js
Created May 1, 2015 00:46
Mount and unmount - reactjs
/**
* Created by clarico on 30/04/2015.
*/
var Button = React.createClass({
getInitialState: function () {
return {val : 0}
},
update : function () {
this.setState({val: this.state.val +1});
},
//see CONSOLE!
var votes = [
"angular",
"angular",
"react",
"react",
"react",
"angular",
"ember",
"react",
@carlosdlf
carlosdlf / MainClass.java
Created November 7, 2015 15:56
Util Date to Sql Date
public class MainClass {
public static void main(String[] args) {
java.util.Date utilDate = new java.util.Date();
java.sql.Date sqlDate = new java.sql.Date(utilDate.getTime());
System.out.println("utilDate:" + utilDate);
System.out.println("sqlDate:" + sqlDate);
}