Skip to content

Instantly share code, notes, and snippets.

Avatar

Anthonny Quérouil anthonny

View GitHub Profile
@magopian
magopian / gist:297d20e95b49daf3ad934e36b1855e82
Created Nov 28, 2018
elm decoder very helpful to debug decoders used in event handlers (thanks @JoelQ on the elm slack)
View gist:297d20e95b49daf3ad934e36b1855e82
module Main exposing (main)
import Html exposing (Html, text)
import Json.Decode as Decode exposing (Decoder)
loggingDecoder : Decoder a -> Decoder a
loggingDecoder realDecoder =
Decode.value
|> Decode.andThen
@dudleycarr
dudleycarr / docker-compose.yml
Created Sep 30, 2015
Docker Compose for nsq, StatsD, Graphite, and Grafana
View docker-compose.yml
graphitestatsd:
image: hopsoft/graphite-statsd
expose:
- 80
- 8125/udp
ports:
- 8080:80
nsqlookupd:
View JdbcStreams.java
public <T> T streamQuery(String sql, Function<Stream<SqlRowSet>, ? extends T> streamer, Object... args) {
return jdbcTemplate.query(sql, resultSet -> {
final SqlRowSet rowSet = new ResultSetWrappingSqlRowSet(resultSet);
final boolean parallel = false;
// The ResultSet API has a slight impedance mismatch with Iterators, so this conditional
// simply returns an empty iterator if there are no results
if (!rowSet.next()) {
return streamer.apply(StreamSupport.stream(Spliterators.emptySpliterator(), parallel));
}
@cletusw
cletusw / .eslintrc
Last active Jan 13, 2021
ESLint Reset - A starter .eslintrc file that resets all rules to off and includes a description of what each rule does. From here, enable the rules that you care about by changing the 0 to a 1 or 2. 1 means warning (will not affect exit code) and 2 means error (will affect exit code).
View .eslintrc
{
// http://eslint.org/docs/rules/
"ecmaFeatures": {
"binaryLiterals": false, // enable binary literals
"blockBindings": false, // enable let and const (aka block bindings)
"defaultParams": false, // enable default function parameters
"forOf": false, // enable for-of loops
"generators": false, // enable generators
"objectLiteralComputedProperties": false, // enable computed object literal property names
View essential-javascript-links.md
@dendrochronology
dendrochronology / styles.less
Last active Jan 18, 2019
Atom.io styles for rainbow indent guides. Yay rainbows!
View styles.less
/*
* Atom Stylesheet
*
* .generate-indents(): makes pretty indent guides.
* Enable 'Settings' -> 'Show Indent Guide' and taste the rainbow!
*
*/
// Default and base colors for indent guides
@indentColor: hsla(345, 100%, 55%, .3); // Manipulate this to make pretty
@dgoguerra
dgoguerra / p4merge-git-tool.md
Last active Jan 22, 2021
Setup p4merge as difftool and mergetool on Windows
View p4merge-git-tool.md

Setting up p4merge as diff and merge tool on Windows. Tried for Git version 1.8.4.msysgit.0.

Two alternatives are explained: using the command line, and directly editing the config file.

Setting up from the command line

Being the installation path "C:Program Files\Perforce\p4merge.exe", just run:

$ git config --global diff.tool p4merge
@coolaj86
coolaj86 / how-to-publish-to-npm.md
Last active Jan 21, 2021
How to publish packages to NPM
View how-to-publish-to-npm.md

Getting Started with NPM (as a developer)

If you haven't already set your NPM author info, now you should:

npm set init.author.name "Your Name"
npm set init.author.email "you@example.com"
npm set init.author.url "http://yourblog.com"

npm adduser