Skip to content

Instantly share code, notes, and snippets.

Pelle Almquist peralmq

Block or report user

Report or block peralmq

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@seansean11
seansean11 / store-types.ts
Last active May 29, 2019
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
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
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 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) {
@jbgo
jbgo / fix-vim-error576.md
Created Nov 28, 2012
Fixing VIM error "E576: viminfo: Missing '>' in line: ..."
View fix-vim-error576.md

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.