Skip to content

Instantly share code, notes, and snippets.

Date: Thu, 10 Sep 2009 01:32:17 -0400
Subject: [PATCH] comparing identical expressions
---
.../alchim/mojo/yuicompressor/BasicRhinoShell.java | 3 ---
1 files changed, 0 insertions(+), 3 deletions(-)
diff --git a/src/main/java/net/sf/alchim/mojo/yuicompressor/BasicRhinoShell.java b/src/main/java/net/sf/alchim/mojo/yuicompressor/BasicRhinoShell.java
index b840f66..a6bc780 100644
--- a/src/main/java/net/sf/alchim/mojo/yuicompressor/BasicRhinoShell.java
<html>
<head>
<style>
#c {
padding: 200px;
margin: 10px;
border: 1px solid #777777;
}
#num span {
font-size: 180%;
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
button::-moz-focus-inner {
border: 0; }
/* minimal
*******************************************************************************/
button.minimal {
@nemtsov
nemtsov / codestyle.js
Created March 13, 2012 23:56
Simple command-line util for beautifying js files.
// prereq: "npm install beautifyjs"
var jsb = require('beautifyjs').js_beautify,
fs = require('fs'),
fileName = process.argv[2];
if ('string' !== typeof fileName) {
console.error('Usage: node codestyle.js fileName');
return;
}
@nemtsov
nemtsov / beautifier.js
Created June 3, 2012 17:24
JS Beautifier with the comma-first style (by Esailija)
/*jslint onevar: false, plusplus: false */
/*
JS Beautifier
---------------
Written by Einar Lielmanis, <einar@jsbeautifier.org>
http://jsbeautifier.org/
@nemtsov
nemtsov / amqp_pubsub.js
Created July 2, 2012 08:10
amqp pub-sub
var cluster = require('cluster')
, amqp = require('amqp');
if (cluster.isMaster) {
for (var i = 0; i < 5; i++) cluster.fork();
startPublisher();
} else {
startSubscriber();
}
@nemtsov
nemtsov / http_request_stats.js
Created July 30, 2012 01:05
first stab at wrapping the http.request
var http = require('http')
, util = require('util');
var CR = http.ClientRequest;
function StatsClientRequest(options, cb) {
CR.call(this, options, cb);
var before = (new Date).getTime();
this.once('response', function (res) {
res.on('end', function () {
var total = ((new Date).getTime() - before);
@nemtsov
nemtsov / stack_util.js
Last active December 10, 2015 03:58
Retrieves the filename of the caller of a function.
StackUtil = {};
/**
* Get the filename of the caller of a function
*
* @param {Boolean} options.isLineNumberRendered
* @return {String} name
*/
StackUtil.getCallerFilename = function (options) {
var name, callSite;
@nemtsov
nemtsov / userinfo.js
Created February 7, 2013 01:54
Workaround for getting the uid / gid when only the 'username' is available. - Advantages: works without needing to compile a C++ addon - Disadvantages: need to be root to run it :(
//-----------------------------------
// userinfo.js
//-----------------------------------
/**
* Workaround for getting
* the uid / gid when only
* the 'username' is available.
*
* Works on POSIX ONLY (i.e. not Windows)
function setProxy {
local proxy=$1
echo "Setting proxy: $proxy"
#TODO: set proxy here
}
function maybeSetProxy {
local proxy=$1
echo "Detecting whether a proxy is needed..."
env -i bash -c "curl -sm2 example.com"