Skip to content

Instantly share code, notes, and snippets.

View abarza's full-sized avatar
🏠
Working from home

Francisco Abarza abarza

🏠
Working from home
  • Chile
View GitHub Profile
@mergeweb
mergeweb / .sass-lint.yml
Last active January 30, 2018 15:57
Default Sass Lint File
#########################
## Sass Lint File
#########################
# sass-lint -v
# Linter Options
options:
# Don't merge default rules
merge-default-rules: false
# Set the formatter to 'stylish'
formatter: compact
@adg29
adg29 / index.html
Last active August 16, 2018 13:39 — forked from zross/index.html
Animate path on Leaflet map using D3
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7/leaflet.css" />
<script src="http://d3js.org/d3.v3.min.js" type="text/javascript"></script>
<script src="http://cdn.leafletjs.com/leaflet-0.7/leaflet.js"></script>
<script src='https://api.tiles.mapbox.com/mapbox.js/v1.6.4/mapbox.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox.js/v1.6.4/mapbox.css' rel='stylesheet' />

Building a MongoDB GUI

A small team at Red Gate recently set out to build a graphical interface for querying and interacting with MongoDB in just one week. As it was a new project, we got to experiment with some of the newer libraries and techniques for building rich web apps in node.js. Here are some of the more interesting things we found.

Architecture

We used express as the framework for the server side application, and browserify (via browserify-middleware) to help us structure the client side application. The beauty of browserify is that it allows us to use node.js style modules on the client side. Rather than choose any specific framework (e.g. angular or ember) we were able to mix and match just the things we needed. This makes it possible to pick the best tool for each individual job.

The client side of the application consists of a main entry point, which uses [page.js](http://vision

@hijonathan
hijonathan / form.html
Last active August 1, 2023 19:14
Submit a HubSpot form with AJAX without redirecting the user.
<form class='form-inline' id='my-custom-form'>
<div class="form-group">
<input type='email' class='form-control' placeholder='Your email address' required>
</div>
<button class="btn btn-primary" type='submit'>Sign up</button>
</form>
<!-- Actual form that gets submitted to HubSpot -->
<div class="hidden" id='hubspot-form'>
<script charset="utf-8" src="//js.hsforms.net/forms/current.js"></script>
@elidickinson
elidickinson / max_width_email.html
Created May 6, 2013 15:10
Email Template trick: max-width with outlook
<!--[if mso]>
<center>
<table><tr><td width="580">
<![endif]-->
<div style="max-width:580px; margin:0 auto;">
<p>This text will be centered and constrained to 580 pixels even on Outlook which does not support max-width CSS</p>
</div>
<!--[if mso]>
@kevinSuttle
kevinSuttle / meta-tags.md
Last active July 10, 2024 09:39 — forked from lancejpollard/meta-tags.md
List of Usable HTML Meta and Link Tags
@oodavid
oodavid / README.md
Last active June 12, 2024 00:28 — forked from aronwoost/README.md
Deploy your site with git

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/
@caseyjustus
caseyjustus / median.js
Created August 23, 2011 19:34
calculate the median of an array with javascript
function median(values) {
values.sort( function(a,b) {return a - b;} );
var half = Math.floor(values.length/2);
if(values.length % 2)
return values[half];
else
return (values[half-1] + values[half]) / 2.0;