Skip to content

Instantly share code, notes, and snippets.

@koshigoe
koshigoe / mount-ram.sh
Created February 11, 2011 14:57
Like tmpfs in Mac OSX
#!/bin/sh
# This program has two feature.
#
# 1. Create a disk image on RAM.
# 2. Mount that disk image.
#
# Usage:
# $0 <dir> <size>
#
@Problematic
Problematic / RegistrationController.php
Created May 26, 2011 16:21
Symfony2 user registration mockup
<?php
namespace Problematic\UserBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Problematic\UserBundle\Entity\User;
class RegistrationController extends Controller
{
@casidiablo
casidiablo / rails-and-mongo.md
Created December 30, 2011 18:39
Steps to create a Rails application with MongoDb

This document contains the steps to create a mongo-enabled Rails 3.1 application. This is just for personal reference actually.

Create base application

We have to skip the Active Record stuff:

rails new app_name --skip-active-record

Add mongo and bson_ext to the Gemfile

@casidiablo
casidiablo / .gitignore
Created March 25, 2012 20:38
Generic .gitignore
.DS_Store
gen
out
bin
*.iml
*.ipr
*.iws
target
tmp
~apklib*
@mikehaertl
mikehaertl / gist:3258427
Created August 4, 2012 15:40
Learn you a Haskell - In a nutshell

Learn you a Haskell - In a nutshell

This is a summary of the "Learn You A Haskell" online book under http://learnyouahaskell.com/chapters.


1. Introduction

  • Haskell is a functional programming language.
import android.content.Context;
import android.text.SpannableStringBuilder;
import android.text.Spanned;
import android.util.AttributeSet;
import android.util.Log;
import android.widget.TextView;
import com.github.jobs.BuildConfig;
import java.util.ArrayList;
import java.util.List;
@ttscoff
ttscoff / searchlink.rb
Last active February 26, 2024 07:05
SearchLink creates Markdown links from automatic searches based on special syntax.
@owainlewis
owainlewis / routes.clj
Created January 9, 2013 17:05
Testing Compojure applications in the REPL.
(defroutes app
(GET "/" [] "<h1>Index route</h1>")
(route/not-found "<h1>Page not found</h1>"))
(defn fake-request [routes uri method & params]
(let [localhost "127.0.0.1"]
(routes {:server-port 80
:server-name localhost
:remote-addr localhost
:uri uri
@nschwermann
nschwermann / README.md
Created May 16, 2013 18:03
Solarized IntelliJ Theme

This tweaks the darcula IntelliJ theme to better match the solarized color scheme found here https://github.com/jkaving/intellij-colors-solarized

To enable, after installing the color scheme linked above set your theme to darcula.

Preferences -> Appearance -> Theme -> Darcula

Exit IntelliJ then add the tweaked darcula properties file to the idea.jar file with the following command

jar -ufv idea.jar com/intellij/ide/ui/laf/darcula/darcula.properties 
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.artifacts.Configuration
import org.gradle.api.file.FileTreeElement
import org.gradle.api.internal.file.FileResolver
import org.gradle.api.internal.tasks.DefaultScalaSourceSet
import org.gradle.api.plugins.JavaBasePlugin
import org.gradle.api.plugins.JavaPluginConvention
import org.gradle.api.reporting.ReportingExtension
import org.gradle.api.tasks.ScalaRuntime