This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class BootstrapFormBuilder < ActionView::Helpers::FormBuilder | |
delegate :capture, :content_tag, :tag, to: :@template | |
%w[text_field text_area password_field collection_select].each do |method_name| | |
define_method(method_name) do |name, *args| | |
errors = object.errors[name].any?? " error" : "" | |
error_msg = object.errors[name].any?? content_tag(:span, object.errors[name].join(","), class: "help-inline") : "" | |
content_tag :div, class: "clearfix#{errors}" do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
ID | |
, USER | |
, HOST | |
, DB | |
, COMMAND | |
, TIME | |
, time/60.0 Seconds | |
, (time/60.0) / 60.0 Hours | |
, STATE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.mysite.model.entities; | |
import java.io.Serializable; | |
import java.lang.reflect.Field; | |
import java.util.ArrayList; | |
import java.util.Arrays; | |
import java.util.List; | |
import org.json.simple.JSONArray; | |
import org.json.simple.JSONObject; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Once the users table is created, you can add users with the SQL below. NOTE, we are using SHA1 in this example and cAsE matters */ | |
/* New User: | |
Username: moehoward | |
Password: nyucknyuck | |
NOTICE: Inside the 'sha1', the string is: password{username} | |
In Spring, we told it to use a salt source of 'username'. But you HAVE to put it in the curly brackets. So, try not to have curly brackets in your password. :-) | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* ************************************************************************ | |
* Class: Random.java | |
* Purpose: Helper class for generating random strings (for new passwords) | |
* Author: Cecil Meeks | |
* Modification History: | |
* 2011 - Cecil Meeks - Creation | |
// ************************************************************************ */ | |
package com.example.common; | |
import java.math.BigInteger; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// not real code...but you get the idea | |
public interface PortalUserService { | |
public PortalUser get(int id); | |
public PortalUser updatePassword(PortalUser paUser, String paNewPassword); | |
} | |
public class PortalUser { | |
String username; | |
String password; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Cleanup-Folders($path) { | |
if($path) { | |
Get-ChildItem -recurse | Where {$_.PSIsContainer -and @(Get-ChildItem -Lit $_.Fullname -r | Where {!$_.PSIsContainer}).Length -eq 0} | Remove-Item -recurse -whatif | |
} | |
} | |
Cleanup-Folders "c:\temp\blah" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var cacheBuster = function() { | |
return Date.now().toString() + Math.random().toString(36).substring(2,7); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body style="margin:0;"> | |
<div id="d" style="background:#ff0;left:200px;position:relative;"> | |
Hello | |
</div> | |
</body> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
declare @data table ( dateid date, timeid time(0), value decimal(19,5) ); | |
declare @DB2_DATE table ( dateid date ); | |
declare @DB2_TIME table ( timeid time(0) ); | |
/* Build DB2 dim tables */ | |
insert into @DB2_DATE values ('2013-03-01') | |
insert into @DB2_DATE values ('2013-03-02') | |
insert into @DB2_DATE values ('2013-03-03') | |
insert into @DB2_DATE values ('2013-03-04') | |
insert into @DB2_DATE values ('2013-03-05') |