Skip to content

Instantly share code, notes, and snippets.

View hullen's full-sized avatar
coffee & learn & code

Hullen Gonzales hullen

coffee & learn & code
View GitHub Profile
@netojoaobatista
netojoaobatista / api-and-ood.md
Created September 23, 2013 16:29
A API e o Design de Software Orientado a Objetos

A API e o Design de Software Orientado a Objetos

Quando falamos sobre design em orientação a objetos, estamos basicamente falando sobre responsabilidade e relacionamento. Com responsabilidade quero dizer algo que alguma coisa faz e com relacionamento quero dizer como alguma coisa utiliza aquilo que outra coisa faz. O Design de Software Orientado a Objetos trata especificamente da forma com que os objetos se relacionam, ou seja, como expor a responsabilidade dos objetos de forma que outros objetos possam se relacionar.

Do ponto de vista do Design de Software Orientado a Objetos, não importa, exatamente, como alguma coisa é feita. Pelo contrário, o objetivo é justamente evitar esse conhecimento sobre a implementação, encapsulando o que é específico para permitir que trabalhemos com a definição conceitual daquilo que precisamos utilizar. Por exemplo, é comum uma aplicação precisar trabalhar com um SGBD. Se nossos objetos tiverem conhecimento específico de que estamos, na verdade, trabalhando com MySQL, e

@minhnc
minhnc / app.js
Created February 27, 2012 14:37
Activity Indicator
var ai = require('ui').activityIndicator();
var win = Ti.UI.createWindow();
win.add( ai );
ai._show({message: 'Loading...'});
// TODO - Access to DB - Here I use timeout for demo purpose
setTimeout(function() {
ai._hide();
}, 2000);
@billerickson
billerickson / functions.php
Last active September 24, 2016 23:36
Hide Editor on Specific Template Page
<?php
/**
* Hide Editor
* @author Bill Erickson
* @link http://www.billerickson.net/code/hide-editor-on-specific-page-template/
*/
function be_hide_editor() {
// Get the Post ID
@raulriera
raulriera / PagingControl.js
Created April 19, 2012 02:13
Custom paging control for scrollableViews for Titanium Appcelerator
// I was unhappy about there was close to no control over the "pageControl"
// in scrollableViews, so I hacked my own
// -----
// Configuration
var pageColor = "#c99ed5";
PagingControl = function(scrollableView){
var container = Titanium.UI.createView({
height: 60
@leommoore
leommoore / mongodb_3.2.x_security.md
Last active October 19, 2018 00:39
MongoDB 3.2.x Security

#MongoDB 3.2.x Security

##Network Ports The standard ports used by mongo are:

ProcessRoleDefault Port
@davist11
davist11 / Fancy File Inputs.js
Created October 25, 2010 21:32
Fancy File Inputs
var SITE = SITE || {};
SITE.fileInputs = function() {
var $this = $(this),
$val = $this.val(),
valArray = $val.split('\\'),
newVal = valArray[valArray.length-1],
$button = $this.siblings('.button'),
$fakeFile = $this.siblings('.file-holder');
if(newVal !== '') {
@necolas
necolas / inline-block-example.html
Created July 28, 2011 16:22 — forked from fcalderan/inline-block-example.html
Inline-block layout component
<div class="ibw">
<div class="ib">inline block</div>
<div class="ib">inline block</div>
<div class="ib">inline block</div>
</div>
@jamsesso
jamsesso / dev-server.js
Last active August 24, 2020 13:27
Webpack dev server with a better proxy (http-proxy-middleware)
var express = require('express');
var path = require('path');
var webpackConfig = require('./webpack.config');
var webpack = require('webpack');
var webpackDevMiddleware = require('webpack-dev-middleware');
var webpackHotMiddleware = require('webpack-hot-middleware');
var proxyMiddleware = require('http-proxy-middleware');
var devConfig = webpackConfig.devServer;
var app = express();
@xumx
xumx / widget.js
Last active October 20, 2020 03:39
KeyReply Chat Widget
(function () {
// Load Stylesheet
var root = 'https://files.keyreply.com'
var head = document.getElementsByTagName('head')[0],
stylesheet = document.createElement('link')
stylesheet.type = 'text/css'
stylesheet.rel = 'stylesheet'
stylesheet.href = root + '/files/boutir.css?13'
head.appendChild(stylesheet)
@jonathantneal
jonathantneal / Demo
Created April 18, 2012 17:13
addEventListener for IE8
http://jsfiddle.net/GuQaV/show/