Skip to content

Instantly share code, notes, and snippets.


Pelle Almquist peralmq

View GitHub Profile
ShopifyEng / Confetti.tsx
Created Apr 6, 2020
Building Arrive's Confetti in React Native with Reanimated - Confetti Final
View Confetti.tsx
import React, {useMemo} from 'react'
import Animated from 'react-native-reanimated'
import {View, Dimensions, StyleSheet} from 'react-native'
import FastImage from 'react-native-fast-image'
import ConfettiImage from 'assets/images/confetti.png'
const NUM_CONFETTI = 100
const COLORS = ['#00e4b2', '#09aec5', '#107ed5']
const CONFETTI_SIZE = 16
seansean11 / store-types.ts
Last active Jun 28, 2020
Using Redux Thunk with Typescript (example)
View store-types.ts
import { ActionCreator } from 'redux'
import { ThunkAction } from 'redux-thunk'
import { WebService } from 'app/services/WebService'
// Create this reusable type that can be imported into your redux action files
export type ThunkResult<R> = ThunkAction<R, RootState, Services, RootAction>
// Services are only necesarry because we are using
// `reduxThunk.withExtraArgument({ webService }))` when we are creating our store.
export type Services = {
artem-zinnatullin / GradleWorkersPleaseStopTakingFocus.gradle
Created Jul 21, 2015
Prevent Gradle Workers from taking focus! #DevelopersLikeComfort
View GradleWorkersPleaseStopTakingFocus.gradle
// You can place it in the root build.gradle
allprojects {
tasks.withType(JavaForkOptions) {
// Forked processes like GradleWorkerMain for tests won't steal focus!
jvmArgs '-Djava.awt.headless=true'
View Future.js
The MIT License (MIT)
Copyright (c) 2014
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
copies of the Software, and to permit persons to whom the Software is
shawncarr / mandrill_validate_webhook
Last active May 25, 2017
Validating a Mandrill Webhook request for nodejs
View mandrill_validate_webhook
var Crypto = require('crypto');
* validates a mandrill webhook request
* @param url string the url that mandrill sent the request to
* @param key string the web hook key from
* @param params array the request's POST parameters i.e. req.params
* @param compareTo string the x-mandrill-signature header value
var validate = function validate(url, key, params, compareTo) {
jbgo /
Created Nov 28, 2012
Fixing VIM error "E576: viminfo: Missing '>' in line: ..."

I was getting the error E576: viminfo: Missing '>' in line: [file names] about ten times with various file names whenever I opened or saved a buffer in Vim. This happened both in normal vim and with MacVim. This was followed by the line E136: viminfo: Too many errors, skipping rest of file. Other than these obnoxious messages, Vim itself worked fine.

To fix it, I opened ~/.viminfo and deleted everything in the section labeled # History of marks within files (newest to oldest):. I lost all my history of marks within files, but that was acceptable for me since I was starting a new coding session for the day.

So far, I'm not sure how my viminfo got into this state.

You can’t perform that action at this time.