Skip to content

Instantly share code, notes, and snippets.

@armw4
armw4 / redux-is-smarter-than-you-think.md
Last active June 19, 2021 20:10
Optimizing your react components via redux....shouldComponentUpdate for free and more...

The Beginning

Yes...it's true...redux is smart....smarter than you even know. It really does want to help you. It strives to be sane and easy to reason about. With that being said, redux gives you optimizations for free that you probably were completely unaware of.

connect()

connect is the most important thing in redux land IMO. This is where you tie the knot between redux and your underlying components. You usually take state and propogate it down your component hiearchy in the form of props. From there, presentational

@pditommaso
pditommaso / gist:cf724c1d2353342784f0
Last active September 20, 2021 15:50
Groovy SHA1 generator
import java.security.*
String password = "toto\n"
MessageDigest sha1 = MessageDigest.getInstance("SHA1")
byte[] digest = sha1.digest(password.getBytes())
System.out.println(new BigInteger(1, digest).toString(16))
@stephanos
stephanos / build.gradle
Created January 27, 2014 09:48
Gradle: Automate IntelliJ IDEA project generation for a Java App Engine project
def jvmRunFlags = '''
-Xmx700m
- ...
'''.split().toList()
def jvmTestFlags = '''
-Dlocally=true
-ea
- ...
'''.split().toList()
@chadmaughan
chadmaughan / pre-commit.sh
Last active November 25, 2022 00:38
A git pre commit hook that runs the test task with the gradle wrapper
#!/bin/sh
# this hook is in SCM so that it can be shared
# to install it, create a symbolic link in the projects .git/hooks folder
#
# i.e. - from the .git/hooks directory, run
# $ ln -s ../../git-hooks/pre-commit.sh pre-commit
#
# to skip the tests, run with the --no-verify argument
# i.e. - $ 'git commit --no-verify'
@rodionmoiseev
rodionmoiseev / gist:2484934
Created April 25, 2012 00:41
Setting up Play 2.0 in build.gradle
apply plugin: 'java'
apply plugin: 'scala'
// For those using Eclipse or IntelliJ IDEA
apply plugin: 'eclipse'
apply plugin: 'idea'
def findPlay20(){
def pathEnvName = ['PATH', 'Path'].find{ System.getenv()[it] != null }
for(path in System.getenv()[pathEnvName].split(File.pathSeparator)){
for(playExec in ['play.bat', 'play.sh', 'play']){