This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sqlite3 | |
conn = sqlite3.connect("mydatabase.db") # or use :memory: to put it in RAM | |
cursor = conn.cursor() | |
# create a table | |
cursor.execute("""CREATE TABLE albums | |
(title text, artist text, release_date text, | |
publisher text, media_type text) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import { | |
AppRegistry, | |
StyleSheet, | |
Text, | |
View, | |
TouchableOpacity | |
} from 'react-native'; | |
class TodosList extends Component { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var catsRouter = express.Router(); | |
var dogsRouter = express.Router(); | |
// setup RESTful ish routes for each router... | |
app.use('/api', catsRouter); | |
app.use('/api', dogsRouter); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var React = require('react') | |
alert('here in index before require') | |
var MyApp = require('./components/myApp') | |
alert('returned from require') | |
React.render( | |
<MyApp /> | |
, document.getElementById('app')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def create | |
@post = Post.new(post_params) | |
end | |
private | |
def post_params | |
params.require(:post).permit(:title, :body) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h2>New project</h2> | |
<%= form_for(@project) do |f| %> | |
<div class="field"> | |
<%= f.label :name %><br /> | |
<%= f.text_field :name %> | |
</div> | |
<div class="field"> | |
<%= f.label :technologies_used %><br /> | |
<%= f.text_area :technologies_used %> |