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
namespace :db do | |
desc "load data from csv" | |
task :load_csv_data => :environment do | |
require 'fastercsv' | |
FasterCSV.foreach("importdata/tarife.csv", :headers => true, :col_sep => ',') do |row| | |
Anbieter.find_or_create_by_name( | |
:name => row['Anbieter_Name'] | |
:hotline => row['Hotline'], | |
:email => row['Email'] |
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
development: | |
adapter: mysql2 # must =~ /mysql/ | |
database: adamDb # required | |
username: your_user | |
password: keep_secret | |
live: | |
ssh_user: # optional, use if live system user differs from your dev user | |
host: example.com # required, can be IP | |
adapter: mysql2 # must =~ /mysql/ |
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
apply = (f) -> | |
args = Array.prototype.slice.call(arguments, 1) | |
(x) -> | |
f.apply null, args.concat x | |
factorial = (n) -> | |
if n | |
factorial(n-1)*n | |
else |
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
client = Foursquare.new(:oauthToken => "", :oauthSecret => "") | |
categories = client.categories() | |
goodCategories = [] | |
categories.each do |category| | |
if category.name != "food" || category.name != "nightlife" | |
goodCategories.push(categoryId) | |
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
#include "../unit-test-framework/unit_test_framework.h" | |
#include "../dlist.h" | |
#include <iostream> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <time.h> | |
using namespace std; | |
/******************************************************** |
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
/** | |
* Copyright 2012 - Ryan Gonzalez - @ryngonzalez - [email protected] | |
* | |
* Director.js | |
* | |
* Takes an audio element and an | |
* object of functions and corresponding | |
* times to execute them during | |
* audio playback. | |
* |
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(jQuery){ | |
$.fn.toggleData = function(dataAttr, onState, offState) { | |
this.attr(dataAttr, this.attr(dataAttr) === onState ? offState : onState) | |
}; | |
})($); |
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
// Ryan Gonzalez 7/2013 | |
// Adapted from the blog post | |
// http://phaistonian.pblogs.gr/expanding-textareas-the-easy-and-clean-way.html | |
angular.module('autoresize', []); | |
angular.module('autoresize') | |
.directive('autoresize', function($window){ | |
'use strict'; | |
return { |
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
angular.module('$app.directives') | |
.directive 'showAfterEvent', ['$timeout', ($timeout)-> | |
return { | |
link: (scope, element, attrs) -> | |
eventName = attrs.showAfterEvent | |
element.css 'opacity', 0 | |
element.bind eventName, (e) -> |
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
%divider { | |
&:after, &:before { | |
display: block; | |
position: absolute; | |
} | |
&:after { | |
text-transform: none; | |
text-shadow: none; | |
@include rem(font-size, 12px); | |
text-align: center; |
OlderNewer