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
1) UsersController create action should destroy session if is present | |
Failure/Error: post :create | |
TypeError: | |
expected numeric or date | |
# ./app/models/user.rb:48:in `user_bigger_than_18' | |
# ./app/controllers/users_controller.rb:11:in `create' | |
# ./spec/controllers/users_controller_spec.rb:67:in `block (2 levels) in <top (required)>' |
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
require "net/http" | |
request = Net::HTTP.new("grooveshark.com") | |
path = '/more.php?getCountry' | |
data = '{"method":"getCountry"}' | |
headers = {'Host' => 'grooveshark.com', | |
'User-Agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:5.0.1) Gecko/20100101 Firefox/5.0.1', | |
'Accept-Encoding' => 'gzip, deflate', | |
'Accept-Charset' => 'utf-8', |
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 TestMe(name) { | |
this.name = name; | |
} | |
TestMe.prototype.sayHello = function() { | |
return "Hello my name is " + this.name; | |
} | |
testme = function(name) { | |
return { |
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 is called with a string | |
def isAnagramOfPalindrome ( S ): | |
# Check length if length even then all need to be two | |
# if not even there must be a -1 | |
dic = {} | |
for c in S: | |
if dic.__contains__(c): | |
dic[c] += 1 |
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
{% block scripts %} | |
<script src="{{ STATIC_URL }}js/libs/jquery.easing.1.3.min.js"></script> | |
<script src="{{ STATIC_URL }}js/libs/jquery.activity-indicator-1.0.0.min.js"></script> | |
<script src="{{ STATIC_URL }}js/intro-animation.min.js"></script> | |
<script src="{{ STATIC_URL }}js/libs/jquery.colorbox-min.js"></script> | |
<script type="text/javascript"> | |
// Piccolo script inline per modale | |
$(function() { | |
$('#gnammo-modal-internal-close').click(function() { | |
$.colorbox.close() |
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 SidebarController($scope, $http) { | |
$http.get('api/factions').success(function(data) { | |
$scope.factions = data; | |
}); | |
$http.get('api/countries').success(function(data) { | |
$scope.countries = data; | |
}); | |
} | |
function MepListController($scope, $http, $routeParams) { |
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
angular.module('TweetYourMep', []). | |
config(['$routeProvider', function($routeProvider) { | |
$routeProvider.when('/name/:name/country/:country/localParty/:localParty/faction/:faction', { templateUrl: "/partials/main.html", controller: RootView} ); | |
$routeProvider.otherwise({redirectTo: '/name/all/country/all/localParty/all/faction/all'}); | |
}]); |
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
from fabric.context_managers import settings | |
from fabric.operations import local | |
def run_unix_command(command): | |
with settings(warn_only= True): | |
return local('ls', capture= True) | |
res = run_unix_command('ls -lah') | |
print res.return_code | |
print res.stdout |
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
import re | |
LIST_RE = re.compile('^\s-\s') | |
DICT_RE = re.compile('^.+\s\|\s.+$') | |
filter_non_empty = lambda x: filter(lambda y: len(y) > 0, x) | |
def _parse_dict(lines): | |
res = {} | |
for line in filter_non_empty(lines): |
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
Blog china kids music yahoo want wrong service tech saying lots had address working following years didn internet wants photos former technology being traffic small past full november experience door company learn paper research sell self sometimes couple video makes next process books could stuff audio web become problem details worth provide feeds another john away hand thanks night test update guy cost product still non drop year tried america amp start podcast month advertising ask almost systems american culture close pictures smart showing popular application e dvd camera links including during university special times party home display star likely room before personal digg yes yet save deal magazine down weekend international box visit making interesting morning enough sound images released again u hour days needs coming through services point cut source though planet entire access turn happens development school however news conference n gave level posts goes sure later case director without list ver |
OlderNewer