mysql> select count(*) from users;
+----------+
| count(*) |
+----------+
| 25305798 |
+----------+
1 row in set (10.24 sec)
# Inplace, rebuilds table, allows DML
View benchmark.md
View ruby_autoload.md
Post.rb
class Post
def self.all
puts Time.now.to_f
'Post@all'
end
end
View laravel_repository.md
// Interface/Contract
interface OrderRepositoryInterface {
public function getAll();
public function find($id);
}
class DbOrderRepository implements OrderRepositoryInterface {
public function getAll()
View flatten.md
Problem:
var input = {
Foo: {
Bar: {
Hello: 2
},
World: 3
},
View 1_react_es6.jsx
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
let styles = { | |
backgroundColor: '#fefefe', | |
color: '#ff0000' | |
} | |
class App extends React.Component { | |
render() { | |
return ( | |
<div style={styles}> |
View react_es5.js
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
let styles = { | |
backgroundColor: '#fefefe', | |
color: '#ff0000' | |
}; | |
let App = React.createClass({ | |
displayName: 'App', | |
render: function () { |
View js_mixins.md
Reference: https://javascriptweblog.wordpress.com/2011/05/31/a-fresh-look-at-javascript-mixins/
Simply put, in JavaScript, implementation of mixins can be done via copying or cloning attributes and methods from mixin objects (reusable code) to Constructor prototypes (main classes).
Classic Mixins (from Reference)
This is like the first approach to come to mind.
// Mixin
View frontend_concepts.md
HTML
CSS
JavaScript
Event Propagation (Bubbling and Capturing)
View android_quick_gcm.md
Quick code to implement/test GCM in an Android Activity
// Custom Push Notifications
String SENDER_ID = "SENDER_ID_FROM_GOOGLE_DEV_CONSOLE";
String regId;
String PROPERTY_REG_ID = "registration_id";
NewerOlder