Skip to content

Instantly share code, notes, and snippets.

View rajat1saxena's full-sized avatar
😃
Building an open-source LMS

Rajat Saxena rajat1saxena

😃
Building an open-source LMS
View GitHub Profile
function Hello(props) {
return <div>{props.name}</div>
}
<Calculator>
<DisplayWindow />
<NumPad>
<Key number={1}/>
<Key number={2}/>
.
.
.
<Key number={9}/>
</NumPad>
@rajat1saxena
rajat1saxena / xhr_request.js
Created September 7, 2017 01:33
Send a XHR request
var xhr = new XMLHttpRequest();
xhr.responseType = 'json';
xhr.open("POST", "/graphql");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.setRequestHeader("Accept", "application/json");
xhr.onload = function () {
console.log('data returned:', xhr.response);
}
xhr.send(JSON.stringify({query: "{ hello }"}));
// Simple example to read a file line by line and multiply values by 2 and write
// to an output file
'use strict';
const stream = require('stream');
// const readStream = new ReadStream({
// read(size) {
// if ()
// }
// });
#So as not to be disturbed by Ctrl-S(XOFF) ctrl-Q(XON) in terminals:
stty -ixon
#!/bin/bash
# Get the IP of the connected android device
IP=`adb shell netcfg | grep wlan0 | awk '{ print $3 }' | awk -F'/' '{ print $1 }'`
# Port used for connecting, on device. Change as required
DEBUG_PORT='5555'
# Start the adb as tcpip deamon
adb tcpip $DEBUG_PORT
@rajat1saxena
rajat1saxena / studio.desktop
Created May 15, 2016 13:51
Android Studio - Ubuntu Launcher
[Desktop Entry]
Name=Android Studio 2
Comment=Official IDE for Android
Exec="/path/to/executable"
Icon="/path/to/icon"
Terminal=false
Type=Application
Categories=Development;IDE;Android;
StartupNotify=true