Skip to content

Instantly share code, notes, and snippets.

View acidtib's full-sized avatar

Dainel Vera acidtib

View GitHub Profile
This file has been truncated, but you can view the full file.
$(document).ready( function() {
//Check if america or international
$('#postcard_global').bind('change', function (e) {
if( $('#postcard_global').val() == "International") {
$('#internationaldiv').show();
$('#americadiv').hide();
}
else if( $('#postcard_global').val() == "America") {
$('#americadiv').show();
$('#internationaldiv').hide();
@acidtib
acidtib / check.js
Created October 8, 2012 14:22 — forked from thomasv314/check.js
// JSON Array of Towns.. In Rails: <%= @towns = Town.all.to_json %>
var TOWNS = [
{ town: "Abbeville city", id: 1 },
{ town: "Adamsville city", id: 2 },
{ town: "Addison Town", id: 3 }
];
$(document).ready(function() {
$('#postcard_city').bind('change', updateStateValue);
def recentpost
@graph = Koala::Facebook::API.new(facebook_auth.oauth_token)
@analytics = @graph.get_object(params[:id])
@recentfeed = @graph.get_connections(params[:id], "posts")
if client_signed_in?
@clients = Client.where(:clabel => current_client.companyname)
end
INSERT INTO `facebooks` (`id`, `client_id`, `provider`, `uid`, `oauth_token`, `oauth_expires_at`, `created_at`, `updated_at`)
VALUES
(1, 1, 'facebook', '100004016931051', 'AAAFhSx2lxZCUBAFraQOqpXSWOEKopMChGFpl9PZBTLrbXGDI7V0CDqYtLLlk2cXH4Px90VEGHGWAi3M9LSNmCoZCIkUXgZB6Jxlh7MUTGRGcb8FGBK5A', '2012-10-10 20:00:00', '2012-10-09 21:25:46', '2012-10-10 18:20:37');
@acidtib
acidtib / push.sh
Created October 19, 2012 19:22
Custom git command with cap deploy
#!/usr/bin/env bash
msg=$1
deploy=$2
if [ -z "$msg" ] ; then
echo "Usage: push 'message'"
echo "Or: push 'message' deploy to cap deploy"
exit 1
fi
git add .
git commit -m "$msg"
before_filter :find_current_site
helper_method :current_site
attr_reader :current_site
private
def find_current_site
@current_site = Client.find_by_comurl(request.host)
end
respond_to do |format|
if @client.save
if @client.dash == 1
format.html { redirect_to sales_prospects_path, notice: 'Prospect was successfully created.' }
elsif @client.employ == 1
format.html { redirect_to liya_clients_show_path(@client.employer), notice: 'Employ was successfully created.' }
else
format.html { redirect_to liya_clients_show_path(@client.id), notice: 'Client was successfully created.' }
end
else
def new
@questionaire = Questionaire.new
1.times do
question = @questionaire.questions.build
1.times { question.answers.build }
end
respond_to do |format|
format.html # new.html.erb
format.json { render json: @questionaire }
<script>
$(document).ready(function(){
var flickrUserId = '59573034@N03'; //User Id
var flickrApiKey = '68dcfff9e2db6c1a901af1cc18c2e888';
$.getJSON('http://api.flickr.com/services/rest/?&method=flickr.people.getPublicPhotos&api_key=' + flickrApiKey + '&user_id=' + flickrUserId + '&format=json&jsoncallback=?', function(data){
$.each(data.photos.photo, function(i,item){
url = "http://farm"+ item.farm +".static.flickr.com/"+ item.server +"/"+ item.id +"_"+ item.secret +"_m.jpg";
$('#photos_here').append('<li><a href="'+ url +'"><img src="'+ url +'" alt="'+ item.title +'" /></a></li>');
});
@acidtib
acidtib / check.js
Created December 5, 2012 16:06 — forked from thomasv314/check.js
// JSON Array of Towns.. In Rails: <%= @towns = Town.all.to_json %>
var TOWNS = [
{ town: "Abbeville city", id: 1 },
{ town: "Adamsville city", id: 2 },
{ town: "Addison Town", id: 3 }
];
$(document).ready(function() {
$('#postcard_city').bind('change', updateStateValue);