Skip to content

Instantly share code, notes, and snippets.

View dvidsilva's full-sized avatar
❤️
Enamorao

Daveed Silva dvidsilva

❤️
Enamorao
View GitHub Profile
@dvidsilva
dvidsilva / fbtoform.js
Last active May 10, 2021 08:55
HTMLForm to Firebase sample
(function(){
var newscript = document.createElement('script');
newscript.type = 'text/javascript';
newscript.async = true;
newscript.src = 'https://www.gstatic.com/firebasejs/3.0.2/firebase.js';
(document.getElementsByTagName('head')[0]||document.getElementsByTagName('body')[0]).appendChild(newscript);
})();
_setFormData = function setFormData (sel, data) {
console.info('setting form to data', data);
@dvidsilva
dvidsilva / filescan.php
Created June 26, 2013 06:58
listar archivos en directorio
<?php
$handler = opendir($directory);
foreach($files as $f){
if(!in_array($f,array('.','..') ) )
echo $f, '<br/>';
}
closedir($handler);
/*cambia foldername por ../ vuelvelo a subir y mira la magia y luego por ../../ y asi :P o por ../nombredeotrodir
/* hasta encontrar lo que buscas
@dvidsilva
dvidsilva / api.js
Created March 12, 2020 19:10
sample api comms file
import fetch from 'isomorphic-fetch';
const Post = (path, data, extraConfig = {}) => {
return fetch(path, {
method: 'POST',
body: JSON.stringify(data),
headers: {
'Content-Type': 'application/json; charset=utf-8',
'Accept': 'application/json',
},
@dvidsilva
dvidsilva / description.md
Last active March 8, 2020 15:44
Challenge #213 [Easy] Pronouncing Hex

Description

The HBO network show "Silicon Valley" has introduced a way to pronounce hex.

Kid: Here it is: Bit… soup. It’s like alphabet soup, BUT… it’s ones and zeros instead of letters.
Bachman: {silence}
Kid: ‘Cause it’s binary? You know, binary’s just ones and zeroes.
Bachman: Yeah, I know what binary is. Jesus Christ, I memorized the hexadecimal 
                    times tables when I was fourteen writing machine code. Okay? Ask me 

what nine times F is. It’s fleventy-five. I don’t need you to tell me what

const Config = require('../config');
const Mailchimp = require('mailchimp-api-v3');
const mailchimp = Config.MAILCHIMP_API_KEY ? new Mailchimp(Config.MAILCHIMP_API_KEY) : {};
const addSubscriber = (email, data, update) => {
if (!email || !Config.MAILCHIMP_API_KEY || !Config.MAILCHIMP_LIST_ID) {
const msg = `Ignoring adding subscriber, missing params ${!email ? 'email': 'config'}`;
console.warn(msg);
return Promise.resolve({ msg });

Effective Engineer - Notes

What's an Effective Engineer?

  • They are the people who get things done. Effective Engineers produce results.

Adopt the Right Mindsets

@dvidsilva
dvidsilva / .vimrc
Created August 22, 2017 03:24
.vimrc files
" don't bother with vi compatibility
set nocompatible
" enable syntax highlighting
syntax enable
" configure Vundle
filetype on " without this vim emits a zero exit status, later, because of :ft off
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
var movies = [
{
title: 'titanic', year: 2000
},
{
title: 'robocop', year: 1990
}];
@dvidsilva
dvidsilva / patch.notes.diablo.3
Created January 12, 2016 21:17
PATCH 2.4.0 NOW LIVE
DATA HOSTED WITH ♥ BY PASTEBIN.COM - DOWNLOAD RAW - SEE ORIGINAL
Patch 2.4.0 Now Live
Kauza 1/12/2016 3
Patch 2.4.0 Now Live
Diablo III patch 2.4.0 is now live in the Americas for PC, PlayStation 4, and Xbox One! Check out the full PC patch notes below to learn all about the latest changes. To view our console patch notes, click here.
Important: Please note that you will not be prompted to download patch 2.4.0 until the patch is live in your home region. If you are logging in from a European or Asian client, you will need to wait for this patch to release in that region before it can be installed. Additionally, if your home region is in the Americas, you will be unable to log into Europe or Asia using Global Play after patch 2.4.0 is live until those regions have also patched.
Diablo III Patch 2.4.0 - v2.4.0.35057
@dvidsilva
dvidsilva / LoadYoutubeVideo
Created January 22, 2014 22:23
Something bla bla bla bla
// 2. This code loads the IFrame Player API code asynchronously.
var tag = document.createElement('script');
tag.src = "http://www.youtube.com/player_api";
var firstScriptTag = document.getElementsByTagName('script')[0];
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
// 3. This function creates an <iframe> (and YouTube player)
// after the API code downloads.
var player;
function onYouTubePlayerAPIReady() {
player = new YT.Player('player', {