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
| # Run it with rake db:populate | |
| namespace :db do | |
| desc "Empty the db and fill it with fake data" | |
| task :populate => :environment do | |
| require 'faker' | |
| Rake::Task['db:reset'].invoke | |
| def time_rand from = 0.0, to = Time.now | |
| Time.at(from + rand * (to.to_f - from.to_f)) |
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 stackoverflow; | |
| import java.util.HashSet; | |
| import java.util.Random; | |
| import java.util.Set; | |
| public class StringsContainingCharacters { | |
| public static void main(String[] args) { | |
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
| // Elements having "button" class will not fire the buddypress callbacks | |
| $.each( $( ".item-list-tabs" ).data( "events" ).click, function ( i, obj ) { | |
| var oldHandler = obj.handler; | |
| obj.handler = function ( event ) { | |
| if ( $( event.target ).hasClass( "button" ) ) | |
| return true; | |
| else | |
| return oldHandler( event ); | |
| } | |
| } |
NewerOlder