Skip to content

Instantly share code, notes, and snippets.

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
@sasajib
sasajib / Sample.java
Last active August 29, 2015 14:11 — forked from kinjouj/Sample.java
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import org.apache.tika.exception.TikaException;
import org.apache.tika.metadata.Metadata;
import org.apache.tika.parser.AutoDetectParser;
import org.apache.tika.parser.ParseContext;
/**
* Convert a decimal to a fraction.
*
* @param number $decimal
* @return string
*/
public static function decimal2fraction($decimal)
{
$decimalBase = --$decimal;
$denomenator = 1;
/**
* Convert a fractinal price to a decimal price.
*
* @param string $fractional
* @return string
*/
public static function fractional2decimal($fractional)
{
list ($numerator, $denomenator) = explode('/', $fractional);
return number_format(($numerator / $denomenator) + 1, 2, '.', '');
@sasajib
sasajib / ucfirst.java
Last active August 29, 2015 14:08 — forked from jimjam88/ucfirst.java
/**
* Mimics PHP's ucfirst function.
*
* @param subject The string to be ucfirst'd
* @return The subject string with an uppercased first character
*/
final public static String ucfirst(String subject)
{
return Character.toUpperCase(subject.charAt(0)) + subject.substring(1);
}
// Imports required
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
/**
* Print a result set to system out.
*
* @param rs The ResultSet to print
* @throws SQLException If there is a problem reading the ResultSet
// Imports required
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;
/**
* Read in a file.
*
* @param path The explicit path to the file to read
* @return The contents of the file as a string
// Imports required
import java.text.SimpleDateFormat;
import java.text.ParseException;
/**
* Convert a date to a different format.
*
* @param currentFormat The current date format
* @param newFormat The new date format
* @param subject The date that's going to be converted
* Downloaded or downloading
=============================
**http://kickass.to/infiniteskills-learning-jquery-mobile-working-files-t7967156.html
**http://kickass.to/lynda-bootstrap-3-advanced-web-development-2013-eng-t8167587.html
**http://kickass.to/lynda-css-advanced-typographic-techniques-t7928210.html
**http://kickass.to/lynda-html5-projects-interactive-charts-2013-eng-t8167670.html
**http://kickass.to/vtc-html5-css3-responsive-web-design-course-t7922533.html
*http://kickass.to/10gen-m101js-mongodb-for-node-js-developers-2013-eng-t8165205.html
*http://kickass.to/cbt-nuggets-amazon-web-services-aws-foundations-t7839734.html
package com.webdev.pavilion.news;
import com.webdev.common.orm.ORMFactory;
import com.webdev.common.service.ApiService;
import com.webdev.common.service.request.ServiceRequest;
import com.webdev.common.service.response.ServiceResponse;
import com.webdev.pavilion.news.mapper.NewsMapper;
import org.apache.ibatis.session.SqlSessionManager;
import java.util.Map;