Skip to content

Instantly share code, notes, and snippets.

View amcorreia's full-sized avatar
🎯
Focusing

Alessandro Madruga Correia amcorreia

🎯
Focusing
  • Depressive world
View GitHub Profile
@amcorreia
amcorreia / new_gist_file.html
Created March 4, 2014 19:39
HTML5 starter page
<!DOCTYPE HTML>
<html>
<head>
<meta charset = "utf-8">
<title></title>
<link rel="stylesheet" href="style.css">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<!--[if IE]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
<script scr ="script/script.js"></script>
</head>
@amcorreia
amcorreia / 0_reuse_code.js
Created March 4, 2014 19:28
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
@amcorreia
amcorreia / bootstrap_dropdown_hover.css
Created March 4, 2014 19:48
How to Make Bootstrap Dropdown Menu Expand on Hover
ul.nav li.dropdown:hover ul.dropdown-menu{
display: block;
}
/* if you want to hide the arrow */
a.menu:after, .dropdown-toggle:after {
content: none;
}
@amcorreia
amcorreia / googlemaps.html
Created March 4, 2014 19:41
Create a google map
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0 maximum-scale=1.0, user-scalable=no" />
<title>Geo Location</title>
<style type="text/css" media="screen">
html{ height: 100%; }
body{ height: 100%; margin: 0; padding: 0; }
#map{ width: 100%; height: 100%; }
<?php
App::uses('FormHelper', 'View/Helper');
/**
* BootstrapFormHelper.
*
* Applies styling-rules for Bootstrap 3
*
* To use it, just save this file in /app/View/Helper/BootstrapFormHelper.php
* and add the following code to your AppController:

(originally from: http://elytra.net/2011/03/31/hello-world/)

Howto

Install nginx+PHP:

brew install https://raw.github.com/ampt/homebrew/php/Library/Formula/php.rb --with-fpm --with-mysql --enable-cgi
brew install nginx
@amcorreia
amcorreia / killtcp.md
Created April 8, 2014 22:47 — forked from christianchristensen/killtcp.md
kill TCP connection
amcorreia@dev emacs-el [master] $ cat calendar-google.el
;; 1) go to Google Calendar UI
;; 2) go to "Settings" link on top right corner
;; 3) choose the "Calendars" tab
;; 4) click on the calendar you want to obtain the magic cookie
;; 5) scroll to the bottom, you will see a row that says "Private Address" and the green button "ICAL" is the link to your magic cookie private ics URL
(defvar my-ical-private-google