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
| $.expsub = function(str, data) { | |
| if (typeof str === 'string' && typeof data !== 'undefined' && typeof data === 'object') { | |
| $.each(str.match(/(#{(?:.*?)})/g), function(i, match) { | |
| replace = data[match.replace(/^#{|}$/g, '')]; | |
| if (typeof replace === 'function') replace = replace(); | |
| str = str.replace(RegExp(match), replace); | |
| }); | |
| return str; | |
| } | |
| } |
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
| <script type="text/javascript"> | |
| function kansu(kansu) { | |
| console.log('Hello'); | |
| } | |
| function kansu2(kansu) { | |
| kansu(); | |
| } | |
| //kansu2(kansu); |
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
| <?php | |
| add_action('template_redirect', 'sample_action'); | |
| function sample_action() { | |
| global $wp; | |
| echo '<pre>'; | |
| var_dump($wp->query_vars); | |
| echo '</pre>'; | |
| $template = _parse_request_uri($wp->query_vars); |
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
| <script type="text/javascript"> | |
| var fruits = ['apple', 'banana']; | |
| var index = 1; | |
| console.log(fruits[index]); | |
| var fruits2 = [['apple', 5], 'banana']; | |
| console.log(fruits2[0][0]); | |
| </script> |
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
| body { | |
| font-family: "Lucida Grande",Helvetica,Arial,Verdana,sans-serif; | |
| } | |
| .jasmine_reporter a:visited, .jasmine_reporter a { | |
| color: #303; | |
| } | |
| .jasmine_reporter a:hover, .jasmine_reporter a:active { |
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($) { | |
| var imageLoad = function(callback) { | |
| var src, timestamp; | |
| src = this.attr('src'); | |
| timestamp = new Date().getTime(); | |
| this.attr({src: src + '?' + timestamp}); | |
| return this.load(callback); | |
| }; | |
| var createImageAndLoad = function(image_path, callback) { |
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
| window.Zenra = (function() { | |
| function Zenra(user_config) { | |
| var default_config = { | |
| subjects: '私 僕 俺 君 わたし ぼく おれ きみ 貴方 あなた'.split(/\s/), | |
| conjunctions: 'は が'.split(/\s/) | |
| }; | |
| if (typeof user_config === 'undefined') { | |
| user_config = {subjects:[], conjunctions:[]}; | |
| } |
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
| <?php | |
| class Post extends AppModel { | |
| var $hasOne = 'PostUser'; | |
| } |
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 QueryParameterConstraint | |
| def initialize(*keys) | |
| @keys = keys | |
| end | |
| def matches?(request) | |
| result = false | |
| @keys.each do |key| | |
| result = request.query_parameters.has_key?(key) | |
| break unless result |
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
| resources :products, only: [:index, :show] | |
| namespace :products do | |
| resources :registrations, only: [:new, :create, :edit, :update] | |
| resources :confirmations, only: [:show, :update] do | |
| get :completion, on: :collection | |
| end | |
| end | |
| namespace :admin do |