Skip to content

Instantly share code, notes, and snippets.

View peralmq's full-sized avatar

Pelle Frank peralmq

View GitHub Profile
@jbgo
jbgo / fix-vim-error576.md
Created November 28, 2012 15:03
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.

@shawncarr
shawncarr / mandrill_validate_webhook
Last active May 25, 2017 12:07
Validating a Mandrill Webhook request for nodejs
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 https://mandrillapp.com/settings/webhooks
* @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) {
/*
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
@artem-zinnatullin
artem-zinnatullin / GradleWorkersPleaseStopTakingFocus.gradle
Created July 21, 2015 19:58
Prevent Gradle Workers from taking focus! #DevelopersLikeComfort
// 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'
}
}
@seansean11
seansean11 / store-types.ts
Last active January 25, 2023 19:03
Using Redux Thunk with Typescript (example)
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 = {
@ShopifyEng
ShopifyEng / Confetti.tsx
Created April 6, 2020 17:11
Building Arrive's Confetti in React Native with Reanimated - Confetti Final
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