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
/* | |
=skin= | |
@name Simpliquity | |
@author Yatrik Solanki | |
@homepage http://www.yatriksolanki.com | |
@email [email protected] | |
@license MPL/LGPL/GPL |
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 :trant do | |
desc "Send email notifications for a project." | |
task :send_notification => :environment do | |
Project.send_notification | |
end | |
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
echo off | |
REM cd into your rails app folder | |
cd e:\webapps\projects | |
REM Then Call the rake task | |
call rake trant:send_notification |
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 :ycpages do | |
desc "Update person gender using RapLeaf's name to gender API." | |
task :update_gender => :environment do | |
Person.all.each do |person| | |
unless person.gender.present? | |
url = "http://api.rapleaf.com/v4/util/name_to_gender/#{person.name.split.first}" | |
response = Net::HTTP.get_response(URI.parse(url)) | |
result = JSON.parse(response.body) | |
if ((result["status"] == "OK") && (result["answer"]["likelihood"].to_f > 0.9)) | |
person.update_attribute(:gender, result["answer"]["gender"]) |
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(){ | |
// Collect all text boxes | |
$textboxes = $(":text"); | |
// call checkForEnter function when a key is pressed | |
$textboxes.keydown(checkForEnter); | |
// This function checks if the Enter key is pressed | |
// If yes then moves the cursor to the next box | |
function checkForEnter(event) { |
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
gem 'pg' | |
group :development do | |
gem 'ruby-debug' | |
end | |
gem 'rake', '~> 0.8.7' | |
gem 'devise' | |
gem 'oa-oauth', :require => 'omniauth/oauth' | |
gem 'omniauth' | |
gem 'haml' | |
gem 'dynamic_form' |
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 bash | |
# bash < <(curl -s https://???) | |
echo "Checking for SSH key, generating one if it exists ..." | |
[[ -f ~/.ssh/id_rsa.pub ]] || ssh-keygen -t rsa | |
echo "Copying public key to clipboard. Paste it into your Github account ..." | |
[[ -f ~/.ssh/id_rsa.pub ]] && cat ~/.ssh/id_rsa.pub | xclip | |
open https://github.com/account/ssh |
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
# Credit: http://richardconroy.blogspot.com/2010/08/capybara-reference.html | |
#Navigating | |
visit('/projects') | |
visit(post_comments_path(post)) | |
#Clicking links and buttons | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') |
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
cd ~ | |
sudo yum update | |
sudo yum install java-1.7.0-openjdk.i686 -y | |
wget https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.19.9.tar.gz -O elasticsearch.tar.gz | |
tar -xf elasticsearch.tar.gz | |
rm elasticsearch.tar.gz | |
mv elasticsearch-* elasticsearch | |
sudo mv elasticsearch /usr/local/share |
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
wget "ftp://ftp.cwru.edu/pub/bash/readline-6.2.tar.gz" | |
tar xf readline-6.2.tar.gz | |
cd readline-6.2 | |
./configure --prefix=$HOME/.rbenv/versions/1.9.3-p0-patched | |
make -j 2 | |
make install | |
cd .. | |
wget "http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz" | |
tar xf yaml-0.1.4.tar.gz |
OlderNewer