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
const r = new RegExp('^(?!.*\.js$).*$'); | |
it('Does not matches .js files', () => { | |
expect(r.test('dir/myFile.js')).toBeFalsy(); | |
expect(r.test('dir.ext/myFile.js')).toBeFalsy(); | |
expect(r.test('myFile.js')).toBeFalsy(); | |
}) | |
it('Matchs other extensions', () => { | |
expect(r.test('dir.something/myFile.other')).toBeTruthy(); |
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 is a minimal working example | |
*/ | |
import React, { Component } from 'react'; | |
import Filters from './Filters'; | |
import InputFilter from './InputFilter'; | |
import allMovies from './movies'; | |
class App extends Component { |
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
configure: creating cache auto/config.cache | |
checking whether make sets $(MAKE)... yes | |
checking for gcc... clang | |
checking whether the C compiler works... yes | |
checking for C compiler default output file name... a.out | |
checking for suffix of executables... | |
checking whether we are cross compiling... no | |
checking for suffix of object files... o | |
checking whether we are using the GNU C compiler... yes | |
checking whether clang accepts -g... yes |
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 () { | |
//Color Stat UI component | |
var ColorStat = flight.component(function () { | |
this.updateColorStat = function (event, data) { | |
var count = parseInt(this.$node.text(), 10); | |
if (this.$node.data('color') == data.color) { | |
this.$node.text(count + 4); | |
} 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title><%= content_for?(:title) ? yield(:title) : "Awesomeness" %></title> | |
<%= csrf_meta_tags %> | |
<!-- Le HTML5 shim, for IE6-8 support of HTML elements --> | |
<!--[if lt IE 9]> |
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
application_helper.rb | |
def avatar_url(user) | |
if user.avatar_url.present? | |
user.avatar_url | |
else | |
default_url = "#{root_url}images/guest.png" | |
gravatar_id = Digest::MD5.hexdigest(user.email.downcase) | |
"http://gravatar.com/avatar/#{gravatar_id}.png?s=48&d=#{CGI.escape(default_url)}" | |
end | |
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
def replace_exception original_exception, new_exception | |
begin | |
yield | |
rescue original_exception | |
raise new_exception | |
end | |
end | |
class OtherException < Exception; end |