Skip to content

Instantly share code, notes, and snippets.

@elbuo8
elbuo8 / doapi.sh
Created November 30, 2013 01:58
Simple script to get all the Ansible requirements for DigitalOcean
endpoints=(sizes regions images ssh_keys)
for i in "${endpoints[@]}"; do
url=`printf "https://api.digitalocean.com/%s/?client_id=%s&api_key=%s" $i $DO_CLIENT_ID $DO_API_KEY`
curl $url | python -mjson.tool
done
var MongoClient = require('mongodb').MongoClient;
function MongoSingle (addr, options, cb) {
if (addr === undefined && process.env.MONGO_URL !== undefined) addr = process.env.MONGO_URL;
if (options instanceof Function) {
cb = options;
options = null;
}
if (addr === undefined) {
<!DOCTYPE html>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
angular.module('HypeM', ['ionic', 'ngResource', 'ngRoute'])
.config(['$routeProvider', function ($routeProvider) {
$routeProvider.
when('/', {
templateUrl: 'partials/player.html',
controller: 'PlayerCtrl'
}).
when('/latest', {
templateUrl: 'partials/player.html',
package main
import (
"bytes"
"encoding/json"
"errors"
"fmt"
"github.com/sendgrid/sendgrid-go"
"log"
"net/http"
$routeProvider.when('/home', {
templateUrl: 'templates/player.html',
controller: 'PlayerCtrl'
});
@elbuo8
elbuo8 / app.js
Created January 20, 2014 02:36
Mobile App Blog
angular.module('tutorial', ['ionic', 'ngRoute'])
.config(['$routeProvider', function ($routeProvider) {
$routeProvider.
when('/', {
templateUrl: 'templates/player.html',
controller: 'PlayerCtrl'
});
}])
.service('Playlist', ['$http', '$q', function ($http, $q) {
return {get: function (params) {
@elbuo8
elbuo8 / app.js
Created January 28, 2014 01:32
Blog Part II
angular.module('tutorial', ['ionic', 'ngRoute'])
.config(['$routeProvider', function ($routeProvider) {
$routeProvider.
when('/', {
templateUrl: 'partials/player.html',
controller: 'PlayerCtrl'
});
}])
.service('Playlist', ['$http', '$q', function ($http, $q) {
return {get: function (params) {
from flask import Flask, request, jsonify
from random import randint
from sendgrid import Mail, SendGridClient
app = Flask(__name__)
app.debug = True
tweets = []
#put code here
<!doctype html>
<head>
<link href="css/bootstrap.css" rel="stylesheet">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript" id="jquery"></script>
</head>
<html>
<title>localchat</title>
<body>
<h1>Sorry, we don't have much stuff yet!</h1>
<!---