Skip to content

Instantly share code, notes, and snippets.

@rishabhp
rishabhp / benchmark.md
Last active Apr 3, 2018
MySQL online schema migration benchmarks
View benchmark.md
mysql> select count(*) from users;
+----------+
| count(*) |
+----------+
| 25305798 |
+----------+
1 row in set (10.24 sec)

# Inplace, rebuilds table, allows DML
@rishabhp
rishabhp / ruby_autoload.md
Last active Sep 5, 2016
Ruby Autoloading (probably what Rails does as well)
View ruby_autoload.md

Post.rb

class Post
  def self.all
    puts Time.now.to_f
    'Post@all'
  end
end
@rishabhp
rishabhp / laravel_repository.md
Last active Aug 18, 2016
Repository Pattern (Laravel)
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
    },
@rishabhp
rishabhp / 1_react_es6.jsx
Last active Apr 10, 2016
React JSX to JS (ES5 and ES6) Transpilation Examples
View 1_react_es6.jsx
let styles = {
backgroundColor: '#fefefe',
color: '#ff0000'
}
class App extends React.Component {
render() {
return (
<div style={styles}>
@rishabhp
rishabhp / react_es5.js
Created Apr 10, 2016
JSX to JS (ES5 and ES6) Transpilation Sample
View react_es5.js
let styles = {
backgroundColor: '#fefefe',
color: '#ff0000'
};
let App = React.createClass({
displayName: 'App',
render: function () {
@rishabhp
rishabhp / js_mixins.md
Last active Aug 29, 2015
Mixins in JavaScript
View js_mixins.md
@rishabhp
rishabhp / frontend_concepts.md
Last active Aug 29, 2015
Important Frontend (HTML/CSS/JS) Concepts to Understand
View android_binder_terminology.md

Binder Terminology

Binder framework

Binder (Framework)

The overall IPC architecture

Binder Driver

The kernel-level driver that fascinates the communication across process boundaries

@rishabhp
rishabhp / android_quick_gcm.md
Created Jan 6, 2015
Quick GCM Implementation in Android
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";
You can’t perform that action at this time.