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
| config.generators do |generators| | |
| generators.helper = false | |
| generators.assets = false | |
| generators.test_framework :rspec, :view_specs => false, :controller_specs => false, | |
| :helper_specs => false, :routing_specs => false, :fixture => true | |
| end |
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
| $(document).ready(function(event) { | |
| $('#countrylist').change(function(e){ | |
| // put code here | |
| }).change(); | |
| }); |
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
| mysql -u user -p -h localhost database < file.sql |
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
| line 205: if chunked? || @header['content-length'] || @status == 304 || @status == 204 || HTTPStatus.info?(@status) |
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
| (0...8).map { (65 + rand(26)).chr }.join | |
| I spend too much time golfing. | |
| (0...50).map { ('a'..'z').to_a[rand(26)] }.join | |
| For lots of good WTFBBQ factor. | |
| And a last one that's even more confusing, but more flexible and wastes less cycles: | |
| o = [('a'..'z'), ('A'..'Z')].map { |i| i.to_a }.flatten | |
| string = (0...50).map { o[rand(o.length)] }.join |
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
| METEOR CORE: | |
| Anywhere: Meteor.isClient | |
| Anywhere: Meteor.isServer | |
| Anywhere: Meteor.startup(func) | |
| Anywhere: Meteor.absoluteUrl([path], [options]) | |
| Anywhere: Meteor.settings | |
| Anywhere: Meteor.release | |
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
| $(document).ajaxStart(function() { | |
| $("#loading").show(); | |
| }); | |
| $(document).ajaxStop(function() { | |
| $("#loading").hide(); | |
| }); |
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 | |
| module UnionScope | |
| def union_scope(*scopes) | |
| id_column = "#{table_name}.id" | |
| if (sub_query = scopes.reject { |sc| sc.count == 0 }.map { |s| s.select(id_column).to_sql }.join(' UNION ')).present? | |
| where "#{id_column} IN (#{sub_query})" | |
| else | |
| none | |
| end |
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
| [a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+(?:[A-Z]{2}|com|org|net|edu|gov|mil|biz|info|mobi|name|aero|asia|jobs|museum)\b |
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 gup( name ) | |
| { | |
| name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]"); | |
| var regexS = "[\\?&]"+name+"=([^&#]*)"; | |
| var regex = new RegExp( regexS ); | |
| var results = regex.exec( window.location.href ); | |
| if( results == null ) | |
| return ""; | |
| else | |
| return results[1]; |
OlderNewer