Skip to content

Instantly share code, notes, and snippets.

View dvrajan's full-sized avatar

Devarajan Narayanan dvrajan

  • N26
  • Berlin, Germany
View GitHub Profile
@dvrajan
dvrajan / index.js
Created March 18, 2018 19:50
Blogpost sample index.js
import React from 'react';
import {AppRegistry} from 'react-native';
import router from './Router'
class Index extends React.Component {
render() {
return router.route(this.props.key, this.props.data)
}
}
@dvrajan
dvrajan / Router.js
Created March 18, 2018 19:47
Blogpost sample Router.js
import React from 'react'
import Component1 from "./components/Component1";
import Component2 from "./components/Component2";
class Router {
constructor(registry = {}) {
this._registry = registry;
}
route(routingKey, props) {
@dvrajan
dvrajan / ReactScreen.java
Last active March 18, 2018 19:40
Blogpost example ReactScreen
public class ReactScreen extends Activity implements DefaultHardwareBackBtnHandler {
protected ReactInstanceManager reactInstanceManager;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
reactInstanceManager = ReactInstanceManager.builder()
.setApplication(this.getApplication())
<html>
<head>
<style>
body{
counter-reset: n;
}
div:before {
counter-increment: n;
content: counter(n);
There is a mine grid of size mxn and the mine positions are known by the system. Now, Given a coordinate display the mine grid. If a mine is hit, End the game else continue the game until all the cells are opened.
Input => 3 3 // mine of size 3 x 3
Input => 12 23 33 // mines are at (1,2) (2,3) (3,3)
Output => x x x
x x x
x x x
Input => 1,1
Output => o x x
"""
Exports Issues from a specified repository to a CSV file
Uses basic authentication (Github username + password) to retrieve Issues
from a repository that username has access to. Supports Github API v3.
"""
import csv
import requests