Skip to content

Instantly share code, notes, and snippets.

View danidiaz's full-sized avatar

Daniel Díaz Carrete danidiaz

View GitHub Profile
@zbigniewTomczak
zbigniewTomczak / maven-archetype.list
Created December 7, 2012 19:36
Maven archetypes list (mvn archetype:generate)
Choose archetype:
1: remote -> br.gov.frameworkdemoiselle.archetypes:demoiselle-jsf-jpa (Archetype for web applications (JSF + JPA) using Demoiselle Framework)
2: remote -> br.gov.frameworkdemoiselle.archetypes:demoiselle-minimal (Basic archetype for generic applications using Demoiselle Framework)
3: remote -> co.ntier:spring-mvc-archetype (An extremely simple Spring MVC archetype, configured with NO XML.)
4: remote -> com.agilejava.docbkx:docbkx-quickstart-archetype (-)
5: remote -> com.alibaba.citrus.sample:archetype-webx-quickstart (-)
6: remote -> com.bsb.common.vaadin:com.bsb.common.vaadin.embed-simple-archetype (-)
7: remote -> com.bsb.common.vaadin:com.bsb.common.vaadin7.embed-simple-archetype (-)
8: remote -> com.cedarsoft.open.archetype:multi (-)
9: remote -> com.cedarsoft.open.archetype:simple (-)
@kvnsmth
kvnsmth / example-subtree-usage.md
Last active September 8, 2025 14:36
A real world usage for git subtrees.

Let's say you have an iOS project, and you want to use some external library, like AFNetworking. How do you integrate it?

With submodules

Add the project to your repo:

git submodule add [email protected]:AFNetworking/AFNetworking.git Vendor/AFNetworking

or something to that effect.

@folsen
folsen / Main.hs
Created March 1, 2013 14:21
JSON backend using Happstack
{-# LANGUAGE DeriveDataTypeable, OverloadedStrings #-}
module Main where
import qualified Data.ByteString.Lazy.Char8 as L
import Control.Monad.IO.Class (liftIO)
import Control.Monad (msum, mzero)
import Data.Data (Data, Typeable)
import Data.Maybe (fromJust)
import Data.Aeson
@atduskgreg
atduskgreg / gist:5100799
Last active December 14, 2015 14:29
Make headless Processing work on Heroku!

I need to run the virtual frame server Xvfb on Heroku. We need this to fake a display on a server that doesn't have one, as the Java Applet class relies on a display.

To run an arbitrary binary on Heroku, the binary need to be compiled as a static linked binary, with all the dependencies bundled with the binary. This is because we can't just run apt-get on Heroku, like on any other normal server.

I've tried to compile as a static binary via Vulcan (https://github.com/heroku/vulcan), but the binary still ends up as a dynamic linked binary that relies on dependencies installed on the OS.

I've tried to compile it on a local Linux like explained here: http://bindle.me/blog/index.php/405/running-binaries-on-heroku But it still ends up as a dynamic linked binary.

This is my question on Stackoverflow:

@nettles-jarrod
nettles-jarrod / blog - Explaining My Choices Further.md
Last active April 25, 2023 19:31
In which I do a little digging about the choices I've made with PHP. This is a long read, but it isn't something that can be explained in one or two paragraphs.

In the comments from my last post and on Twitter I noticed a lot of people who had something to say about PHP. The comments were varied but they usally sounded something like this (sorry @ipetepete, I picked yours because it was the shortest).

...the little bits of soul from all of us who've had to work on, and or maintain large PHP applications. – ipetepete

In Pete's defense, he did go on to say that rest of the stack I was using was a "smorgasbord of awesome". Thanks, Pete. I agree!

I would, however, like to take a little time to correct a misperception in the developer community about PHP. I recently got into this same... discussion... with Jeff Atwood, and I seem to be running into it more and more. So here goes. Please bear with me as I cover a little history further on.

Pete, and everybody else, _you're exactly rig

@sjoerdvisscher
sjoerdvisscher / updatemonad.hs
Created May 8, 2013 09:21
The update monad which generalizes the reader, writer and state monad from http://homepages.inf.ed.ac.uk/s1225336/talks/types13.pdf
{-# LANGUAGE TypeSynonymInstances, FlexibleInstances, MultiParamTypeClasses #-}
import Data.Monoid
import Data.Monoid.Action
import Data.Monoid.MList (SM(..))
import Control.Monad.Trans.Class
newtype UpdateT p s m a = UpdateT { runUpdateT :: s -> m (p, a) }
@sjoerdvisscher
sjoerdvisscher / LinearMap.hs
Last active December 17, 2015 03:59
Linear map category and products.
{-# LANGUAGE TypeFamilies, ConstraintKinds, GADTs, TypeOperators, UndecidableInstances #-}
{-# LANGUAGE CPP #-}
import Prelude hiding ((.))
import Data.VectorSpace
import Data.Category
import Data.Category.Limit
type a :* b = (a,b)
@willurd
willurd / web-servers.md
Last active November 18, 2025 14:46
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@mvr
mvr / gist:8081429
Last active November 10, 2023 02:36
A Whirlwind Tour of Combinatorial Games in Haskell
A Whirlwind Tour of Combinatorial Games in Haskell
==================================================
Combinatorial games are an interesting class of games where two
players take turns to make a move, changing the game from one position
to another. In these games, both players have perfect information
about the state of the game and there is no element of chance. In
'normal play', the winner is declared when the other player is unable
to move. A lot of famous strategy games can be analysed as
combinatorial games: chess, go, tic-tac-toe.
@fsodogandji
fsodogandji / socat-tips.sh
Last active August 8, 2025 04:36
socat tips & tricks
#To create a classic TCP listening daemon, similar to netcat -l, use a variation of the following command.
socat TCP-LISTEN:8080 stdout
#use remotly a command shell
socat TCP4-LISTEN:1234,reuseaddr,fork 'SYSTEM:/bin/cat /home/infos.txt'
#sslify a server
socat OPENSSL-LISTEN:443,reuse‐addr,pf=ip4,fork,cert=server.pem,cafile=client.crt TCP4-CONNECT:localhost:80