# This example does an AJAX lookup and is in CoffeeScript
$('.typeahead').typeahead(
# source can be a function
source: (typeahead, query) ->
# this function receives the typeahead object and the query string
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
describe 'App.HeaderModule', -> | |
beforeEach -> | |
@headerModule = window.App.HeaderModule | |
it 'should exist', -> | |
expect(@headerModule).not.toBeUndefined() | |
describe 'starting', -> |
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
def select_from_chosen(item_text, options) | |
field_id = find_field(options[:from])[:id] | |
within "##{field_id}_chzn" do | |
find('a.chzn-single').click | |
input = find("div.chzn-search input") | |
# in some cases, chosen may not has a search field | |
# so, find li that contains item_text | |
find("li:contains('#{item_text}')").click | |
end | |
end |
Tested in Ubuntu Server 14.04
Installing java and maven3
sudo apt-add-repository ppa:andrei-pozolotin/maven3
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install maven3 oracle-java8-installer
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
var Utils = { | |
/* modified version of https://gist.github.com/1243697 | |
* adds detection of file extension rather than hard-coding .jpg as in the original | |
*/ | |
_getExtension: function(fn) { | |
// from http://stackoverflow.com/a/680982/292947 | |
var re = /(?:\.([^.]+))?$/; | |
var tmpext = re.exec(fn)[1]; | |
return (tmpext) ? tmpext : ''; | |
}, |
Prereq:
apt-get install zsh
apt-get install git-core
Getting zsh to work in ubuntu is weird, since sh
does not understand the source
command. So, you do this to install zsh
wget --no-check-certificate http://install.ohmyz.sh -O - | sh
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
<?php | |
/** | |
* Total stops | |
* Execute the code at http://sandbox.onlinephpfunctions.com/code/98e0909b60bc2f1096961cc2a7be39efd7cab6cb | |
* @param array $A people weights | |
* @param array $B people destination floor | |
* @param int $M total floors | |
* @param int $X elevator's people capacity | |
* @param int $Y elevator's weight capacity | |
* @return int total stops |
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
/** | |
* Author: Richard Willis - badsyntax.co | |
* Example here: http://demos.badsyntax.co/places-search-bootstrap/example.html | |
* | |
* Please note: This is not a reliable method of geocoding the address. Using the | |
* PlacesService is a much better approach. View the example above for an example | |
* of using the PlacesService to geocode the address. | |
*/ | |
var service = new google.maps.places.AutocompleteService(); |
Add the following line to /etc/gai.conf
...
precedence ::ffff:0:0/96 100
... so that the system gives preference to IPv4, avoiding IPv6 timeout.
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
import React from 'react'; | |
import compose from 'recompose/compose'; | |
import classNames from 'classnames'; | |
import styles from './styles.scss'; | |
import pure from 'recompose/pure'; | |
const Timeline = ({className, children}) => { | |
const classes = classNames(className, styles.timeline); | |
return (<div className={classes}>{children}</div>); | |
}; |
OlderNewer