Skip to content

Instantly share code, notes, and snippets.

@dstarh
dstarh / ip.rb
Created February 12, 2009 16:35
get ip via ruby
#!/usr/local/bin/ruby
require 'net/http'
require 'uri'
require 'rubygems'
require 'json'
module JSONIP
def r(a){def i=a.indexOf(48);if(i<0)print a else(('1'..'9')-(0..80).collect{j-> g={(int)it(i)==(int)it(j)};g{it/9}|g{it%9}|g{it/27}&g{it%9/3}?a[j]:'0'}).each{ r(a[0..<i]+it+a[i+1..-1])}}
declare @meal_scale_id int
set @meal_scale_id = 5041
;with order_seq_num(meal_scale_id,recipe_scale_id,sort_value)
as (
Select ms.meal_scale_id, ms.recipe_scale_id, sort_value = row_number() over(partition by meal_scale_id order by sort_value) -1
from ed_diet_meal_scale_recipe_scale_xref ms with(nolock)
--where ms.meal_scale_id in (5389,5391,5393,5041)
)
// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/kpdus/jad.html
// Decompiler options: packimports(3)
// Source File Name: ExternalEnum.java
import java.io.PrintStream;
public class ExternalEnum
{
package com.common.security.pgp;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
#!/bin/bash
_m2_make_goals()
{
plugin=$1
mojos=$2
for mojo in $mojos
do
export goals="$goals $plugin:$mojo"
done
def dao = """
package com.activedg.vendor.dao;
import org.springframework.stereotype.Repository;
import com.activedg.vendor.model.${args[0]};
@Repository
public class ${args[0]}Dao extends GenericDAO<${args[0]}, Long> {
public ${args[0]}Dao() {
package util.validation;
import java.lang.reflect.InvocationTargetException;
import models.bpo.SubjectMarketability;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.beanutils.converters.BooleanConverter;
import org.apache.commons.lang.StringUtils;
@dstarh
dstarh / gist:921930
Created April 15, 2011 15:54
warning you're going to be dumber after reading this
package util.validation;
import java.lang.reflect.InvocationTargetException;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.lang.StringUtils;
import play.data.validation.Check;
public class RequiredIfOtherEqualsValueMin extends Check {
package adt.reflexam.transformer;
public interface GenericTransformer<F, T> {
public T transform(F from);
}