Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Subramanya Chakravarthy chakrihacker

🎯
Focusing
Block or report user

Report or block chakrihacker

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@chakrihacker
chakrihacker / PanResponder_Overview.js
Created Aug 16, 2019 — forked from teameh/PanResponder_Overview.js
React native PanResponder interface overview
View PanResponder_Overview.js
this._panResponder = PanResponder.create({
// ----------- NEGOTIATION:
// A view can become the touch responder by implementing the correct negotiation methods.
// Should child views be prevented from becoming responder on first touch?
onStartShouldSetPanResponderCapture: (evt, gestureState) => () => {
console.info('onStartShouldSetPanResponderCapture');
return true;
},
@chakrihacker
chakrihacker / glob-search.js
Created Jun 13, 2019
Search for specific files recursively through sub directories
View glob-search.js
var glob = require("glob"),
// some options
options = {
cwd: "/Users/subramanya/Code/quantcommune/app-react/src"
},
// for Files
forFiles = function(err, files) {
console.log(files);
};
@chakrihacker
chakrihacker / walksync.js
Created Jun 5, 2019 — forked from kethinov/walksync.js
List all files in a directory in Node.js recursively in a synchronous fashion
View walksync.js
// List all files in a directory in Node.js recursively in a synchronous fashion
var walkSync = function(dir, filelist) {
var fs = fs || require('fs'),
files = fs.readdirSync(dir);
filelist = filelist || [];
files.forEach(function(file) {
if (fs.statSync(dir + file).isDirectory()) {
filelist = walkSync(dir + file + '/', filelist);
}
else {
@chakrihacker
chakrihacker / flatlist.jsx
Created Oct 7, 2018
FlatList with some data
View flatlist.jsx
class FlatListDemo extends Component {
state = {
loading: false,
data: [],
page: 1,
seed: 1,
error: false,
}
componentDidMount () {
View basic-flatlist.jsx
<FlatList
data={[{key: 'a'}, {key: 'b'}]}
renderItem={({item}) => <Text>{item.key}</Text>}
/>
@chakrihacker
chakrihacker / .zshrc
Created Sep 4, 2017
My zsh configuration
View .zshrc
# If you come from bash you might have to change your $PATH.
export PATH=$HOME/bin:/usr/local/bin:$PATH
export NVM_DIR="/home/chakrihacker/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
export NODE_PATH=/usr/lib/nodejs:/usr/lib/node_modules:/usr/share/javascript:/home/chakrihacker/.nvm/versions/node/v4.5.0/lib/node_modules
# yarn
export PATH="$PATH:`yarn global bin`"
# Path to your oh-my-zsh installation.
@chakrihacker
chakrihacker / xls_to_json.py
Created Apr 5, 2017 — forked from yosemitebandit/xls_to_json.py
converting xls files to JSON dicts in python
View xls_to_json.py
"""XLS -> json converter
first:
$ pip install xlrd
then:
$ cat in.xls
date, temp, pressure
Jan 1, 73, 455
Jan 3, 72, 344
View keybase.md

Keybase proof

I hereby claim:

  • I am chakrihacker on github.
  • I am chakrihacker (https://keybase.io/chakrihacker) on keybase.
  • I have a public key ASBxXwgW7d900MP6-K3z-mHFK1keDy2qW3yZExmOfDcDwQo

To claim this, I am signing this object:

View Random Color Generator Using JavaScript
console.log("#" + Math.random().toString(16).slice(2, 8));
var randomColor = Math.floor(Math.random()*16777215).toString(16);
console.log(randomColor);
View Emergency Server
cd /path/to/dir/with/the/index/file
Using Python
python -m SimpleHTTPServer
Using NodeJS
npm install -g http-server
http-server
You can’t perform that action at this time.