Skip to content

Instantly share code, notes, and snippets.

@isaacs
isaacs / node-and-npm-in-30-seconds.sh
Last active July 21, 2024 01:20
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
@darktable
darktable / app.yaml
Created March 16, 2011 19:10
GAE: App.yaml designed for serving a static site on Google App Engine (Python). Copy your static html and files into a folder called "static" next to app.yaml. Contains a bunch of mimetype declarations from html5boilerplate's .htaccess. May not be neces
application: you-app-name-here
version: 1
runtime: python
api_version: 1
default_expiration: "30d"
handlers:
- url: /(.*\.(appcache|manifest))
mime_type: text/cache-manifest
@guilleiguaran
guilleiguaran / em-http-serv.rb
Created April 1, 2011 01:54
Node.js vs EventMachine
require 'eventmachine'
require 'evma_httpserver'
class MyHttpServer < EM::Connection
include EM::HttpServer
def post_init
super
no_environment_strings
end
@drewwells
drewwells / core.test.js
Created April 14, 2011 20:21
RequireJS and QUnit sitting in a tree
//Wait for relevant code bits to load before starting any tests
define(['core.js'], function( core ) {
module("Core Tests");
test("Test core methods", function(){
expect(2);
equals( 1, 1, "A trivial test");
ok( true, "Another trivial test");
});
@searls
searls / maven-git-flow.sh
Created June 24, 2011 00:25
My approximation of nvie's git flow when using maven-release-plugin to cut releases. - http://nvie.com/posts/a-successful-git-branching-model/
# How to perform a release with git & maven following the git flow conventions
# ----------------------------------------------------------------------------
# Finding the next version: you can see the next version by looking at the
# version element in "pom.xml" and lopping off "-SNAPSHOT". To illustrate,
# if the pom's version read "0.0.2-SNAPSHOT", the following instructions would
# perform the release for version "0.0.2" and increment the development version
# of each project to "0.0.3-SNAPSHOT".
# branch from develop to a new release branch
git checkout develop
@tankchintan
tankchintan / gist:1335220
Last active November 30, 2019 00:17
Procedure for installing and setting Sun JDK Java on Default Amazon Linux AMI
# First verify the version of Java being used is not SunJSK.
java -version
# Get the latest Sun Java SDK from Oracle http://www.oracle.com/technetwork/java/javase/downloads/jdk-7u1-download-513651.html
wget http://download.oracle.com/otn-pub/java/jdk/7u1-b08/jdk-7u1-linux-i586.rpm
# Rename the file downloaded, just to be nice
mv jdk-7u1-linux-i586.rpm\?e\=1320265424\&h\=916f87354faed15fe652d9f76d64c844 jdk-7u1-linux-i586.rpm
# Install Java
@spikebrehm
spikebrehm / eventable.js
Created March 30, 2012 17:54
Add Backbone-style events to any function's prototype
/**
* This is intended to be a simple behavior mixin that allows Backbone-style event delegation to be added to any object's prototype.
*
* Use:
*
* function MyView(){ this.$el = $('#my_view'); this.delegateEvents(); }
* $.extend(MyView.prototype, Eventable);
* MyView.prototype.events = {'click a.close': 'close'};
* MyView.prototype.close = function(){ this.$el.hide(); }
*
@yclian
yclian / Version.java
Created May 7, 2012 12:54
Version Comparator in Java
package foo;
import static java.util.regex.Pattern.compile;
import static org.apache.commons.lang3.StringUtils.substringAfter;
import java.util.Arrays;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.apache.commons.lang3.StringUtils;
User Agent Usage for Maven, Ivy and Gradle for September 17th to 21st (inclusive)
11 Apache-Ivy 1.3.1
256 Apache-Ivy 2.0.0
26 Apache-Ivy 2.0.0-rc1
10 Apache-Ivy 2.0.0-rc1-local-20080903101936
2207 Apache-Ivy 2.0.0-rc2
2106 Apache-Ivy 2.1.0
1 Apache-Ivy 2.1.0-local-20100113152513
55 Apache-Ivy 2.1.0-rc1
@jabbrwcky
jabbrwcky / dynamicVersion.gradle
Created November 2, 2012 08:42
Dynamic versions for gradle, git-flow and Java development
/*
* This work is licensed under the Creative Commons Attribution 3.0 Unported License.
*
* To view a copy of this license, visit http://creativecommons.org/licenses/by/3.0/
* or send a letter to Creative Commons, 444 Castro Street, Suite 900, Mountain View, California, 94041, USA.
*/
/*
* Define your version here
*/