Skip to content

Instantly share code, notes, and snippets.

@3dd13
3dd13 / read_gmail_messages_by_label.rb
Created February 6, 2014 18:09
snippet to read your gmail emails by label
require 'gmail'
require 'dotenv'
Dotenv.load
label_name = "" # label name here
Gmail.new(ENV["GMAIL_USERNAME"], ENV["GMAIL_PASSWORD"]) do |gmail|
mail_with_label = gmail.label(label_name)
@3dd13
3dd13 / application.html.ejs
Created April 3, 2014 01:52
Working with i18n in geddy.this example shows how to see chinese translated text in http://localhost:4000/?locale=zh-tw
<!-- app/views/layouts/application.html.ejs -->
<!-- generate a link with to switch locale -->
<ul>
<li><%- linkTo(i18n.getText("nav.links.switch_to_english"), {locale: "en-us"}) %></li>
<li><%- linkTo(i18n.getText("nav.links.switch_to_chinese"), {locale: "zh-tw"}) %></li>
</ul>
@3dd13
3dd13 / controllers.js
Created June 15, 2015 12:33
Testing ngCordova geolocation watchPosition and getCurrentPosition function
.controller('DashCtrl', function($scope, $ionicPlatform, $cordovaGeolocation) {
var watch;
var watchOptions = {
timeout : 5000,
maximumAge: 3000,
enableHighAccuracy: true // may cause errors if true
};
var pollCurrentLocation = function() {
$cordovaGeolocation.getCurrentPosition(watchOptions)