Skip to content

Instantly share code, notes, and snippets.

View danielvlopes's full-sized avatar

Daniel Lopes danielvlopes

View GitHub Profile
detailsDialog = (map, marker)->
topic = getTopic()
if marker.info
marker.info.close()
marker.info = null
info = new google.maps.InfoWindow
pixelOffset: new google.maps.Size(10,-40)
location = marker.getPosition()
info.setPosition(location)
<html>
<head>
<style type="text/css">
body {
margin: 0px;
padding: 0px;
background: #25262B;
}
</style>
</head>
./configure --prefix=/usr/local/bin/luajit --with-lua-include=/usr/local/Cellar/luajit/2.0.3_1/include/luajit-2.0/
.show-copy-changes {
position: fixed;
bottom: 0;
right: 0;
padding: 10px;
background: #FFEC98;
color: #000;
cursor: pointer;
z-index: 1000;
$(this).redactor({
initCallback: function(){
this.opts.modal_image = TEMPLATES["modal_image"](this)
this.opts.modal_file = TEMPLATES["modal_file"](this)
this.opts.modal_image_edit = TEMPLATES["modal_image_edit"](this)
}
});
@danielvlopes
danielvlopes / resource_controller_spec.rb
Created January 20, 2014 02:28
Example on how we do controller/integration specs in our projects at Starter League (linked on http://www.starterleague.com/tar)
require 'spec_helper'
describe ResourcesController do
render_views
let(:course) { courses :ruby }
let(:resource) { resources :text_resource }
let(:teacher) { course.teachers.first }
let(:student) { course.students.first }
- if feature_available? :profile_activity
.recent-activity
bla bla
bla bla
bla bla
@danielvlopes
danielvlopes / 0_reuse_code.js
Created September 30, 2013 18:32
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@danielvlopes
danielvlopes / checkbox-css-replacement.html
Created September 9, 2013 12:01
CSS replacement for checkbox
<html>
<head>
<title>Checkbox</title>
<style>
input[type=checkbox] {
display:none;
}
input[type=checkbox] + label
{
function get_avatar_from_service(service, userid, size) {
// this return the url that redirects to the according user image/avatar/profile picture
// implemented services: google profiles, facebook, gravatar, twitter, tumblr, default fallback
// for google use get_avatar_from_service('google', profile-name or user-id , size-in-px )
// for facebook use get_avatar_from_service('facebook', vanity url or user-id , size-in-px or size-as-word )
// for gravatar use get_avatar_from_service('gravatar', md5 hash email@adress, size-in-px )
// for twitter use get_avatar_from_service('twitter', username, size-in-px or size-as-word )
// for tumblr use get_avatar_from_service('tumblr', blog-url, size-in-px )
// everything else will go to the fallback
// google and gravatar scale the avatar to any site, others will guided to the next best version