Skip to content

Instantly share code, notes, and snippets.

View Sam1301's full-sized avatar

Saumya Bhatnagar Sam1301

View GitHub Profile
@gnprice
gnprice / .gitconfig
Last active December 22, 2023 20:53
gitconfig
# This is a snapshot of my ~/.gitconfig file, minus a few bits
# that are obsolete or non-reusable.
#
# For explanation of each setting, see `git help config`
# or https://git-scm.com/docs/git-config .
#
[user]
name = Greg Price
email = gnprice@gmail.com
[alias]
@gcanti
gcanti / HOC.js
Created September 14, 2016 09:24
/* @flow */
import React from 'react'
import ReactDOM from 'react-dom'
type FunctionComponent<A> = (props: A) => ?React$Element<any>;
type ClassComponent<D, A, S> = Class<React$Component<D, A, S>>;
type Component<A> = FunctionComponent<A> | ClassComponent<any, A, any>;
@sharmaeklavya2
sharmaeklavya2 / cp_syllabus.md
Last active July 23, 2024 03:38
Competitive Programming Syllabus

Competitive Programming Syllabus

Geometry

  • Problems - Refer the article for a list of problems which can be solved using Rotating Calipers technique.
@dabit3
dabit3 / Animated.stagger()
Created August 1, 2016 00:50
React Native Animated.stagger()
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View,
Animated
} from 'react-native'
const arr = []
@dabit3
dabit3 / Animated.sequence()
Last active December 15, 2020 07:44
React Native Animated.sequence()
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View,
Animated
} from 'react-native'
const arr = []
@joshma
joshma / WhyDidYouUpdateMixin.js
Last active May 9, 2018 06:17
Performance Engineering with React (Part 2)
/* eslint-disable no-console */
import _ from 'underscore';
/*
Drop this mixin into a component that wastes time according to Perf.getWastedTime() to find
out what state/props should be preserved. Once it says "Update avoidable!" for {state, props},
you should be able to drop in React.addons.PureRenderMixin
React.createClass {
mixins: [WhyDidYouUpdateMixin]
@shark0der
shark0der / ubuntu14.04-command-line-install-android-sdk
Last active March 7, 2021 15:09 — forked from wenzhixin/ubuntu14.04-command-line-install-android-sdk
Ubuntu 14.04 command line install android sdk (platform & platform-tools only, no emulator)
# install java
apt-get install -y software-properties-common
apt-add-repository -y ppa:webupd8team/java
apt-get update
apt-get install -y oracle-java8-installer
# download latest android sdk
# http://developer.android.com/sdk/index.html#Other
cd /opt
wget http://dl.google.com/android/android-sdk_r24.4.1-linux.tgz
@mikaelbr
mikaelbr / destructuring.js
Last active April 25, 2024 13:21
Complete collection of JavaScript destructuring. Runnable demos and slides about the same topic: http://git.mikaelb.net/presentations/bartjs/destructuring
// === Arrays
var [a, b] = [1, 2];
console.log(a, b);
//=> 1 2
// Use from functions, only select from pattern
var foo = () => [1, 2, 3];
@mwunsch
mwunsch / emoji.rb
Created October 20, 2012 03:40
emoji unicode to emoji-cheat-sheet.com codes
#!/usr/bin/env ruby
EMOJI_NAME_TO_CODEPOINT = {
"1F604" => :smile,
"1F606" => :laughing,
"1F60A" => :blush,
"1F603" => :smiley,
"263A" => :relaxed,
"1F60F" => :smirk,
"1F60D" => :heart_eyes,