Skip to content

Instantly share code, notes, and snippets.

View domix's full-sized avatar
🇲🇽

Domingo Suarez Torres domix

🇲🇽
View GitHub Profile
@danieldietrich
danieldietrich / FizzBuzz.java
Last active July 31, 2020 22:14
FizzBuzz with Vavr using Either
import static io.vavr.API.*;
import io.vavr.collection.Iterator;
import io.vavr.control.Either;
public class FizzBuzz {
public static void main(String[] args) {
var fizzBuzz = Iterator.from(1).map(i ->
@timyates
timyates / arrowdoc.groovy
Created April 11, 2015 09:10
ascii-image and document-builder sitting in a tree
@Grab(group='com.craigburke.document', module='pdf', version='0.3.1')
@Grab(group='com.craigburke.document', module='word', version='0.3.1')
@Grab('com.bloidonia:ascii-image:1.1')
import com.bloidonia.asciiimage.AsciImageProcessor
import java.awt.image.BufferedImage
import java.awt.RenderingHints
import java.awt.Color
import javax.imageio.ImageIO
import com.craigburke.document.builder.PdfDocumentBuilder
#%RAML 0.8
title: World Music API
baseUri: http://example.api.com/{version}
version: v1
schemas:
- halLink: |
{ "$schema": "http://json-schema.org/schema",
"type": "object",
"description": "a Hypertext Application Language link",
@AWolf81
AWolf81 / SpringMVCWebConfig.java
Last active July 25, 2020 11:49
Spring boot configuration file (annotation-based) - configures localization
package mongodbdemo.config;
import java.util.Locale;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.support.ReloadableResourceBundleMessageSource;
@staltz
staltz / introrx.md
Last active November 19, 2024 18:00
The introduction to Reactive Programming you've been missing
@nodesocket
nodesocket / logstash
Created July 7, 2013 01:18
LogStash init.d service script.
#! /bin/sh
#
# /etc/rc.d/init.d/logstash
#
# Starts Logstash as a daemon
#
# chkconfig: 2345 20 80
# description: Starts Logstash as a daemon
### BEGIN INIT INFO
@cholick
cholick / build.gradle
Created June 10, 2012 00:50
Gradle task for gmetrics
//Minimal configuration needed for Gradle build file with GMetrics integration
apply plugin: 'groovy'
repositories {
mavenCentral()
}
configurations {
gmetrics
}
<?php
function seo($url) {
$url = strToLower($url);
$url = str_replace(
array("á", "é", "í", "ó", "ú", "ñ", "ü"),
array("a", "e", "i", "o", "u", "n", "u"),
$url);
$tokens = preg_split("/[^a-zA-Z0-9]+/", $url);
$url = implode("-", $tokens);