Skip to content

Instantly share code, notes, and snippets.

View dvidsilva's full-sized avatar
❤️
Enamorao

Daveed Silva dvidsilva

❤️
Enamorao
View GitHub Profile

Keybase proof

I hereby claim:

  • I am dvidsilva on github.
  • I am dvidsilva (https://keybase.io/dvidsilva) on keybase.
  • I have a public key whose fingerprint is 4408 194C 5E0E DC7E ED83 830B ECF6 B6A9 5D87 FD19

To claim this, I am signing this object:

Verifying that +dvidsilva is my Bitcoin username. You can send me #bitcoin here: https://onename.io/dvidsilva

/

  • /_files <-- random stuff
  • /build <-- publicly accessible ignore the contents of this in .gitignore
  • /assets
  • /less
  • /images
  • /fonts
  • /vendor
@dvidsilva
dvidsilva / promise-sample.js
Created August 29, 2014 02:51
function promises thingie angularjs
f.getCallHistory = function(){
var request = $http({
data: {
method: 'doctors.get_member_history',
id: f.id,
params: {
call_id : f.call_id
},
jsonrpc: '2.0'
},
@dvidsilva
dvidsilva / XHR request
Created October 23, 2014 07:33
Creating an XHR request with JavaScript
function ajax() {
var xmlhttp;
xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4 ) {
if(xmlhttp.status == 200){
document.getElementById("response").innerHTML = xmlhttp.responseText;
}
@dvidsilva
dvidsilva / designer.html
Created November 16, 2014 17:58
designer
<link rel="import" href="../polymer/polymer.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
height: 100%;
@dvidsilva
dvidsilva / imgur.rb
Created December 9, 2014 11:59
Imgur API wrapper for Ruby
# require 'imgur/version'
require 'httparty'
require 'net/http'
module Imgur
HTML_PATH = 'https://imgur.com/'
API_PATH = 'https://api.imgur.com/3/'
UPLOAD_PATH = 'upload'
IMAGE_PATH = 'image/'
@dvidsilva
dvidsilva / es6
Created February 3, 2015 02:34
es6 and recursion, examples from http://raganwald.com/2015/02/02/destructuring.html
const length = ([first, ...rest]) =>
first === undefined
? 0
: 1 + length(rest);
const flatten = ([first, ...rest]) => {
if (first === undefined) {
return [];
}
window.addEventListener("orientationchange", handleOrientation, true);
function handleOrientation(){
if (Math.abs(window.orientation) == 90) {
angular.element(document.querySelector('#imagenBackground')).attr("src","img/background-landscape.png");
angular.element(document.querySelector('#imagen-Background')).css("width","35%");
} else {
angular.element(document.querySelector('#imagenBackground')).attr("src","img/background-portrait.png");
angular.element(document.querySelector('#imagen-Background')).css("width","45%");
}
@dvidsilva
dvidsilva / README.md
Last active August 29, 2015 14:17 — forked from nikcub/README.md