Skip to content

Instantly share code, notes, and snippets.

View RyanFriedman's full-sized avatar

Ryan Friedman RyanFriedman

View GitHub Profile
@RyanFriedman
RyanFriedman / giveaway.js
Created September 3, 2017 01:09
Poorly written Ruby on Rails code from SynaypseIndia - SynapseIndia.com
function entryFunction(){
$("#save_modal_radio_id").click(function(){
saveModal('radio');
})
$("#dynamic_location_field").click(function(){
dynamic_location_field()
});
$("#concate_location").click(function(){
concatLocations();
});
//
// HMNavigationLabel.m
// Hypemarket
//
// Created by Ryan Friedman on 7/31/15.
// Copyright (c) 2015 vibrantlight. All rights reserved.
//
#import "HMNavigationLabel.h"
require 'faye/websocket'
require 'thread'
require 'redis'
require 'json'
require 'erb'
module ChatDemo
class ChatBackend
KEEPALIVE_TIME = 15 # in seconds
CHANNEL = "chat-demo"
class User < ActiveRecord::Base
attr_accessible :profile_picture_album_id
has_many :albums
has_many :photos
has_many :profile_pictures,
:through => :albums,
:source => :profile_picture_album_id
SampleApp::Application.routes.draw do
namespace :api do
resources :tokens, :only => [:create, :destroy]
end
end
<!DOCTYPE html>
<head>
<script>
/* attach a submit handler to the form */
$(document).ready(function () {
$("#one").click(function(event) {
/* stop form from submitting normally */
event.preventDefault();
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js" type="text/javascript" />
<style type="text/css">
#nav li{
display: inline;
list-style-type: none;
}
</style>
</head>
class Post < ActiveRecord::Base
attr_accessor :position, :follower_id
has_many :relationships, :dependent => :destroy,
:foreign_key => "follower_id"
has_many :reverse_relationships, :dependent => :destroy,
:foreign_key => "followed_id",
:class_name => "Relationship"
<%= gmaps({
"map_options" => { "type" => "ROADMAP", "center_longitude" => 180, "zoom" => 3, "auto_adjust" => true},
"markers" => {
"data" => json_array(@posts).to_json
}
}) %>
def index
@search = params[:search]
end