Please, before you write any more SQL interfacing code, you must read up on proper SQL escaping to avoid severe SQL injection bugs like the ones you have here. Also, mysql_query should not be used in new applications. It's a deprecated interface that's being removed from future versions of PHP. A modern replacement like PDO is not hard to learn and is a safer way to compose queries. $_POST data never goes directly in a query.
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
| twttr.BANNED_PASSWORDS = ["111111","11111111","112233","121212","123123","123456","1234567","12345678","131313","232323","654321","666666","696969","777777","7777777","8675309","987654","aaaaaa","abc123","abc123","abcdef","abgrtyu","access","access14","action","albert","alexis","amanda","amateur","andrea","andrew","angela","angels","animal","anthony","apollo","apples","arsenal","arthur","asdfgh","asdfgh","ashley","asshole","august","austin","badboy","bailey","banana","barney","baseball","batman","beaver","beavis","bigcock","bigdaddy","bigdick","bigdog","bigtits","birdie","bitches","biteme","blazer","blonde","blondes","blowjob","blowme","bond007","bonnie","booboo","booger","boomer","boston","brandon","brandy","braves","brazil","bronco","broncos","bulldog","buster","butter","butthead","calvin","camaro","cameron","canada","captain","carlos","carter","casper","charles","charlie","cheese","chelsea","chester","chicago","chicken","cocacola","coffee","college","compaq","computer","cookie","cooper","corvette","cowbo |
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
| # This relates to the issue described at: | |
| # https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/4709 | |
| class String | |
| def %(args) | |
| if args.kind_of?(Hash) | |
| dup.gsub(INTERPOLATION_PATTERN_WITH_ESCAPE) do |match| | |
| if match == '%%' | |
| '%' | |
| else |
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 Test::Unit::TestCase | |
| alias_method :run_without_transaction, :run | |
| def run(result) | |
| exception = nil | |
| Sequel::Model.db.transaction do | |
| begin | |
| run_without_transaction(result) | |
| rescue => exception | |
| # Capture exception, if raised |
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
| #!/bin/sh | |
| MYSQL_USER=root | |
| MYSQL_PASSWORD=<PASSWORD> | |
| MYSQL_OPTS= | |
| RETAIN_PERIOD=5 | |
| DUMP_DIRECTORY="$HOME/dumps" |
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
| module ActiveRecord | |
| class Base | |
| def self.sqlserver_connection(config) #:nodoc: | |
| config = config.dup.symbolize_keys! | |
| config.reverse_merge! :mode => :dblib, :host => 'localhost', :username => 'sa', :password => '' | |
| mode = config[:mode].to_s.downcase.underscore.to_sym | |
| case mode | |
| when :dblib | |
| # <monkeypatch> | |
| # raise ArgumentError, 'Missing :dataserver configuration.' unless config.has_key?(:dataserver) |
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
| diff --git a/Manifest.txt b/Manifest.txt | |
| index 6e79ebd..6a2f480 100644 | |
| --- a/Manifest.txt | |
| +++ b/Manifest.txt | |
| @@ -121,6 +121,7 @@ test/rubygems/rubygems_plugin.rb | |
| test/rubygems/sff/discover.rb | |
| test/rubygems/simple_gem.rb | |
| test/rubygems/test_config.rb | |
| +test/rubygems/test_deprecate.rb | |
| test/rubygems/test_gem.rb |
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
| #!/usr/bin/env ruby | |
| require 'benchmark' | |
| LETTERS = ('a'..'z').to_a.freeze | |
| def random_customer_name | |
| name = [ ] | |
| (rand(10) + 1).times 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
| module.exports = { | |
| stringifyPart: function(part) { | |
| switch(typeof part) { | |
| case 'boolean': | |
| case 'number': | |
| return String(part) | |
| case 'string': | |
| return '"' + part.replace(/\\/g, '\\\\').replace(/"/g, '\\"') + '"' | |
| case 'undefined': | |
| return 'NULL' |
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
| #!/usr/bin/env ruby | |
| require 'benchmark' | |
| count = 10e6.to_i | |
| Benchmark.bm do |x| | |
| x.report(:mod) { count.times { |n| n % 2 == 0 } } | |
| x.report(:and) { count.times { |n| n & 1 == 0 } } | |
| x.report(:odd) { count.times { |n| n.even? } } |