Skip to content

Instantly share code, notes, and snippets.

View Thivieira's full-sized avatar

Thiago Vieira Thivieira

View GitHub Profile
@Thivieira
Thivieira / nearby-coordinates.sql
Created April 19, 2018 03:25 — forked from statickidz/nearby-coordinates.sql
Ordering with SQL by nearest latitude & longitude coordinates (MySQL & SQLite)
---
METHOD 1
This should roughly sort the items on distance in MySQL, and should work in SQLite.
If you need to sort them preciser, you could try using the Pythagorean theorem (a^2 + b^2 = c^2) to get the exact distance.
---
SELECT *
FROM table
ORDER BY ((lat-$user_lat)*(lat-$user_lat)) + ((lng - $user_lng)*(lng - $user_lng)) ASC
@Thivieira
Thivieira / index.html
Created March 2, 2018 23:11
React Redux modals with portals(3/3)
<!-- What our app will be rendered into -->
<div id="app"></div>
@Thivieira
Thivieira / config.rb
Last active July 7, 2017 03:52 — forked from nathansmith/config.rb
Example config.rb file for Compass
preferred_syntax = :scss
http_path = '/'
css_dir = 'assets/css'
sass_dir = 'assets/scss'
images_dir = 'assets/images'
javascripts_dir = 'assets/js'
relative_assets = true
line_comments = true
# output_style = :compressed
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
@Thivieira
Thivieira / config.json
Last active December 20, 2016 15:44 — forked from anonymous/config.json
Bootstrap Customizer Config (SKELETON TABLE)
{
"vars": {
"@gray-base": "#000",
"@gray-darker": "lighten(@gray-base, 13.5%)",
"@gray-dark": "lighten(@gray-base, 20%)",
"@gray": "lighten(@gray-base, 33.5%)",
"@gray-light": "lighten(@gray-base, 46.7%)",
"@gray-lighter": "lighten(@gray-base, 93.5%)",
"@brand-primary": "darken(#428bca, 6.5%)",
"@brand-success": "#5cb85c",