Skip to content

Instantly share code, notes, and snippets.

View nickmoorman's full-sized avatar

Nick (Moorman) Sawyer nickmoorman

  • Etsy
  • Portland, OR
View GitHub Profile
@nickmoorman
nickmoorman / README.md
Created December 7, 2012 14:59 — forked from jxson/README.md
README.md template

Synopsis

At the top of the file there should be a short introduction and/ or overview that explains what the project is. This description should match descriptions added for package managers (Gemspec, package.json, etc.)

Code Example

Show what the library does as concisely as possible, developers should be able to figure out how your project solves their problem by looking at the code example. Make sure the API you are showing off is obvious, and that your code is short and concise.

Motivation

moormann@moormannmbpx7:~/dev/git/stash/techrepublic (master)$ composer install
Loading composer repositories with package information
Installing dependencies from lock file
Your requirements could not be resolved to an installable set of packages.
Problem 1
- The requested package doctrine/common could not be found in any version, there may be a typo in the package name.
Problem 2
- The requested package jms/di-extra-bundle could not be found in any version, there may be a typo in the package name.
Problem 3
moormann@moormannmbpx7:~/dev/git/stash/techrepublic (master)$ composer update fly/
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
- The requested package symfony/symfony == 2.1.9999999.9999999-dev could not be found.
Problem 2
- The requested package symfony/assetic-bundle == 9999999-dev could not be found.
Problem 3
## Environment Variables
## =====================
# Enable Git completions
source ${HOME}/.gitcompletion.bash
# Executables for local PHP 5.4 development stack
PATH=/usr/local/sbin:/usr/local/apache2/bin:/usr/local/bin:/usr/local/mysql/bin:${PATH}
PATH="$(brew --prefix php54)/bin:$PATH"
{
id: 428977109894430700,
id_str: '428977109894430721',
text: 'No such pipe, or this pipe has been deleted',
source: '<a href="http://goo.gl/IQ4Cjt" rel="nofollow">twitfeed сервер1</a>',
truncated: false,
in_reply_to_status_id: null,
in_reply_to_status_id_str: null,
in_reply_to_user_id: null,
in_reply_to_user_id_str: null,
{
"totalTweets": 26,
"tweetsPerMinute": {
"all": 0.0009084556254367575,
"tr": 0.0008385744234800839,
"zd": 0.0002445842068483578
},
"tweetsPerBrand": {
"tr": 24,
"zd": 7
extends layout
block content
div(id="debt-solver-app")
header
h1= title
p Welcome to #{title}
p This app was written to help solve the all-too-familiar problem of paying off one's debt.
section(id="main")
// Define array and a function to return the max of two numbers
val arr = Array(1, 2, 3, 4, 5)
def getMax(a :Int, b :Int) : Int = if (a > b) a else b
// Use foldLeft to find the max in the array
val max1 = (Integer.MIN_VALUE /: arr) { (large, elem) => getMax(large, elem) }
// No need to use sensible variable names, just use underscores!
val max2 = (Integer.MIN_VALUE /: arr) { getMax(_, _) }
@nickmoorman
nickmoorman / Application.scala
Created August 19, 2014 18:53
Creating a JSON response from a map with Play Scala 2.3.x
package controllers
import scala.collection.mutable.{Map => MMap}
import play.api.libs.json.{Json, JsValue}
import play.api.mvc._
object Application extends Controller {
def index = Action {
@nickmoorman
nickmoorman / gist:0a9b49e8d8344fa4fde2
Created April 6, 2015 15:54
Because I just HAD to see for myself...
$ cat *.java
public class ThisTest1 {
private String foo;
public ThisTest1() {
this.foo = "some string";
}
}
public class ThisTest2 {
private String foo;