Skip to content

Instantly share code, notes, and snippets.

View AlexandrBasan's full-sized avatar
:octocat:
Building an effective team which works from home full-time

Alexandr Basan AlexandrBasan

:octocat:
Building an effective team which works from home full-time
View GitHub Profile
@AlexandrBasan
AlexandrBasan / browser_geo_check
Created October 6, 2014 09:05
Javascript code for browser address check using Google API
<input id="latlng_user_geo" type="hidden" value="40.714224,-73.961452">
<input id="city_user_geo" type="hidden" value="40.714224,-73.961452">
<input id="state_user_geo" type="hidden" value="40.714224,-73.961452">
<input id="country_user_geo" type="hidden" value="40.714224,-73.961452">
<input id="route_user_geo" type="hidden" value="40.714224,-73.961452">
<input id="street_user_geo" type="hidden" value="40.714224,-73.961452">
<input id="complete_address_geocode_user_geo" type="text" value="40.714224,-73.961452">
<button onclick="getLocation()">Check your position</button>
<div id="map-canvas_user_geo" style="height: 200px;
@AlexandrBasan
AlexandrBasan / gist:5281cbcb71ec0e00cc83
Created October 6, 2014 14:18
Teleport SaaS (www.teleport-ds.com) create store form
<!DOCTYPE html>
<html>
<head>
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
<script src="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<!-- CSS Styles-->
<style>
.overflowb{
overflow: auto!important;
@AlexandrBasan
AlexandrBasan / gist:6ed9744bdc8067581b5d
Created October 6, 2014 14:19
Teleport SaaS (www.teleport-ds.com) create user form
<!DOCTYPE html>
<html>
<head>
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
<script src="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<!-- CSS Styles-->
<style>
.overflowb{
overflow: auto!important;
@AlexandrBasan
AlexandrBasan / gist:b445ba8604f62824e0a6
Created October 6, 2014 14:20
Teleport SaaS (www.teleport-ds.com) create warehouse and warehouser form
<!-- Our module use: - Google Maps API 3 for Autocompete Addresses, - Raty Jquery Rating, - Bootstrap 3.0 for styling -->
<!DOCTYPE html>
<html>
<head>
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
<script src="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<!-- CSS Styles-->
<style>
.overflowb{
@AlexandrBasan
AlexandrBasan / gist:3edfc68e8ddd21196017
Last active August 29, 2015 14:07
Teleport SaaS (www.teleport-ds.com) create inquiry form
<!-- Our module use: - Google Maps API 3 for Autocompete Addresses, - Raty Jquery Rating, - Bootstrap 3.0 for styling -->
<!DOCTYPE html>
<html>
<head>
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
<script src="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<!-- CSS Styles-->
<style>
.overflowb{
@AlexandrBasan
AlexandrBasan / gist:db42498905dc9f8091c2
Created October 6, 2014 16:57
Teleport SaaS (www.teleport-ds.com) check inquiry status form
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<!-- Teleport LOGO for some CMS delivery select -->
<img id="teleport_logo" onclick="ShowForm()" src="http://www.teleport-ds.com/assets/teleport_logo_eng_0-97dc4f4c6a152de97ea2e046e7dcc824.png">
<!-- Show form if logo click -->
<script>
$("#teleport_logo").click(function () {
@AlexandrBasan
AlexandrBasan / gist:ef1dc00d3d61e4e3f704
Created October 20, 2014 06:32
Convert address to Google Maps address using Google Geocode. Complete address form
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&libraries=places&language=en"></script>
<script>
var geocoder;
function geocode_rates_import() {
geocoder = new google.maps.Geocoder();
var address = document.getElementById('address_geocode').value;
<%= text_field_tag nil, nil, :id => 'destination_name', data: {autocomplete_source: Airport.order(:name).map { |t| { :label => t.name, :value => t.id } } } %>
<%= text_field_tag nil, nil, :id => 'destination_id' %>
<script>
$("#destination_name").autocomplete({
source:$('#destination_name').data('autocomplete-source'),
select: function(e, ui) {
e.preventDefault() // <--- Prevent the value from being inserted.
$(this).val(ui.item.label)
$('#destination_id').val(ui.item.value)
}
@AlexandrBasan
AlexandrBasan / gist:304cf54e45c7735a566e
Last active August 29, 2015 14:18
Ruby URL PARSER (find all http tags and img tags on page)
<% link_result = Array.new([]) %>
<% img_result = Array.new([]) %>
<% require 'open-uri' %>
<% uri = URI.parse('http://url.com') %>
<% data = uri.read %>
<% @links = data.scan(URI.regexp(%w(http https))) %>
</br>
<% @links.each do |element| %>
@AlexandrBasan
AlexandrBasan / gist:e428025c9e9f389fe17d
Created April 9, 2015 00:20
Ruby find all elements between two symbols
<% array_table = a.scan(/\((.*?)\ =>/) %>
<% array_index = a.scan(/\[(.*?)\]/) %>
<% com = "" %>
<% array_table.length.times do |element| %>
<% if com != array_table[element].join(', ')%>
<!-- Add commit -->
# <%= array_table[element].join(', ') %></br>
<% end %>
<!-- Text construction for output -->
add_index :<%= array_table[element].join(', ') %>, :<%= array_index[element].join(', ') %></br>