This file contains 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 QuestionsMarks(str) { | |
let numbers = []; | |
let inputStrArr = str; | |
let numbersWithIndex = []; | |
let result = false; | |
for (let i = 0; i < inputStrArr.length; i++) { | |
if (parseInt(inputStrArr[i], 10)) { | |
numbers.push(inputStrArr[i]); | |
numbersWithIndex.push({ |
This file contains 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 findIntersection(strArr) { | |
let result = []; | |
if (Array.isArray(strArr)) { | |
let arg1 = strArr[0].split(",").map(elem => elem.trim()); | |
let arg2 = strArr[1].split(",").map(elem => elem.trim()); | |
arg1.filter(a => { | |
if (arg2.includes(a)) { | |
result.push(a.trim()); | |
} | |
}); |
This file contains 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 node | |
/** | |
* | |
* Basic static web server with logger using node.js. | |
* Listen on port 8880, IP defaults to 127.0.0.1 | |
* | |
**/ | |
'use strict'; | |
var http = require("http"), |
This file contains 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
source :rubygems | |
gem 'sinatra' | |
gem 'multi_json' | |
gem 'rack' |
This file contains 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
# unicorn_rails -c /data/github/current/config/unicorn.rb -E production -D | |
rails_env = ENV['RAILS_ENV'] || 'production' | |
# 16 workers and 1 master | |
worker_processes (rails_env == 'production' ? 16 : 4) | |
# Load rails+github.git into the master before forking workers | |
# for super-fast worker spawn times | |
preload_app true |
This file contains 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
require 'rubygems' | |
require 'active_support/all' | |
require 'oauth2' | |
config = { | |
:mode => :token, | |
:client_id => SET_YOUR_OWN, | |
:client_secret => SET_YOUR_OWN, | |
:redirect_uri => SET_YOUR_OWN, | |
:authorization_code => SET_YOUR_OWN, |
This file contains 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
require 'active_support/inflector' | |
require 'benchmark' | |
# QUICK HACK | |
class RuleSet | |
def initialize | |
@rules = [] | |
@regexp = nil | |
end |
This file contains 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
require 'spec_helper' | |
describe "posts/show.html.erb" do | |
before(:each) do | |
@post = assign(:post, stub_model(Post,:id=>1,:title => "Test",:description=>'Want to contribute Engines')) | |
end | |
it "displays the post title with description" do | |
render | |
rendered.should contain("Test") | |
rendered.should contain("Want to contribute Engines") |
This file contains 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
require 'spec_helper' | |
describe "posts/new.html.erb" do | |
before(:each) do | |
@post = assign(:post, stub_model(Post)).as_new_record.as_null_object | |
end | |
it "renders the form partial" do | |
render | |
rendered.should have_selector('form',:method => "post",:action => posts_path) do |form| | |
form.should have_selector('label',:for=>'post_title',:content=>'Title') |
This file contains 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
<html> | |
<head> | |
<style type="text/css"> | |
@media screen and (-webkit-min-device-pixel-ratio:0) { | |
.myClass { background-color: #FF0000; } | |
#myId{color:#444} | |
body:nth-of-type(1) .chrome{border:1px solid red} | |
} | |
</style> | |
</head> |
NewerOlder