Skip to content

Instantly share code, notes, and snippets.

View sunny-g's full-sized avatar

Sunny Gonnabathula sunny-g

View GitHub Profile
this.ycQuestions = [
"So what are you working on?",
"Have you raised funding?",
"What makes new users try you?",
"What competition do you fear most?",
"What’s the worst thing that has happened?",
"Will you reincorporate as a US company?",
"What’s an impressive thing you have done?",
"Where is the rocket science here?",
"Why did you pick this idea to work on?",
@grayrest
grayrest / index.jsx
Created April 12, 2016 18:12
Mobx Uptime Boxes
import React, {Component} from 'react';
import ReactDOM from 'react-dom';
import {observable, computed} from 'mobx';
import {observer} from 'mobx-react';
// import DevTools from 'mobx-react-devtools';
class Server {
@observable days = [];
@observable name = "";
@computed get upDays() {
@axic
axic / stringaskey.sol
Last active July 10, 2019 00:10
How to use string as a key in a mapping in Solidity aka. how to store short strings cheape
//
// In Solidity, a mapping is like a hashmap and works with `string` like this:
// mapping (string => uint) a;
//
// However it doesn't support accessors where string is a key:
// mapping (string => uint) public a;
//
// "Internal compiler error: Accessors for mapping with dynamically-sized keys not yet implemented."
//
// An accessor returns uint when called as `a(string)`.
@yinghaochan
yinghaochan / barChart.html
Last active February 29, 2016 21:10
Bar chart in react
<html>
<head>
<meta name="description" content="React Barchart animated">
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.5.1/lodash.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.6/d3.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.14.7/react-with-addons.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.14.7/react-dom.js"></script>
<meta charset="utf-8">
@joshduck
joshduck / gist:0c35f70cdd3abf88770c
Created February 24, 2016 21:58
ReactPerf to Web Tracing Framework
const ReactPerf = require('ReactPerf');
const TRACE_DOM = false;
function reactPerfTrace(objName: string, fnName: string, func: any): any {
return function(component) {
let label;
if (objName === 'ReactCompositeComponent') {
var instName = this.getName() || 'Unknown';
label = fnName === 'mountComponent' || fnName === 'updateComponent' ? instName : `${instName}.${fnName}`;

🚥 solve the Error: Naming collision detected for fbjs on react-native start

rm -rf node_modules/
npm i
npm uninstall fbjs
find . -name 'fbjs' -print | grep "\./node_modules/fbjs" -v | xargs rm -rf
npm i fbjs
@vasanthk
vasanthk / System Design.md
Last active July 14, 2025 03:42
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@oxyflour
oxyflour / hindley-milner.ts
Last active October 23, 2024 07:09
a typescript implement of hindley-milner type inference
// a typescript implement of hindley-milner type inference
// reference http://smallshire.org.uk/sufficientlysmall/2010/04/11/a-hindley-milner-type-inference-implementation-in-python/
/// <reference path="./lib.es6.d.ts" />
// ...
interface AstNode {
}
class Id implements AstNode {
@t20100
t20100 / mpl_interaction.py
Created January 29, 2016 09:53
Pan and zoom interaction over a matplotlib Figure
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# /*##########################################################################
#
# Copyright (c) 2016 European Synchrotron Radiation Facility
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
const stateIdLens = propLens('id')
const stateTokenLens = propLens('token')
let setCurrentUserId = (state, action) => set(idLens, action.payload.result, state)
let setCurrentUserToken = (state, action) => set(tokenLens, action.payload.token, state)
compose(setCurrentUserId, setCurrentUserToken)