Skip to content

Instantly share code, notes, and snippets.

❤️
Enamorao

Dvid Silva dvidsilva

❤️
Enamorao
Block or report user

Report or block dvidsilva

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@dvidsilva
dvidsilva / table.fn.php
Created Sep 30, 2012
Auto Create a Table from an associative array
View table.fn.php
public function table($array,$headers = '',$title = ''){
$table = '';
$table .= "<table id=table class=table >\n";
if($title != ''){
$table .= "<caption >$title</caption>\n";
}
$table .=" <thead><tr>\n";
$r = 1;
if(!is_array($headers)){
$headers = array_keys($array[0]);
@dvidsilva
dvidsilva / q2ar.fn.php
Created Sep 30, 2012
Returns the result of a query as an array
View q2ar.fn.php
//receives a query and returns an array in the following format
// array['row-number']['field_name'] = 'value'
function q2ar($query){
$query = $this->mysql($query);
$n=0;
$data = '';
if(is_resource($query)){
while($row = mysql_fetch_row($query) ){
$i=0;
while ($i < mysql_num_fields($query)){
@dvidsilva
dvidsilva / DB test
Created Oct 10, 2012
tells you how much it would take to add several lines in your db
View DB test
<?
ini_set('max_execution_time',0);
//tells you how much it would take to add several lines in your db, change ur password and all that off //course..
//_GET[i] is the ammount of lines
$time_start = microtime(true);
$sql = mysql_connect('localhost','root','magic');
mysql_select_db('test',$sql);
mysql_set_charset('utf8');
@dvidsilva
dvidsilva / .vimrc
Last active Dec 12, 2015
My Vim Config File
View .vimrc
function! CHANGE_CURR_DIR()
let _dir = expand("%:p:h")
exec "cd " . _dir
unlet _dir
endfunction
autocmd BufEnter * call CHANGE_CURR_DIR()
set statusline=%<%f%h%m%r%=%{&ff}\ %l,%c%V\ %P
set history=99999
set nonu
@dvidsilva
dvidsilva / tommorrow-night.vim
Created Mar 28, 2013
colors/tommorrow-night.vim
View tommorrow-night.vim
"tommorrow-night - Full Colour and 256 Colour
" http://chriskempson.com
"
" Hex colour conversion functions borrowed from the theme "Desert256""
" Default GUI Colours
let s:foreground = "c5c8c6"
let s:background = "000000"
let s:selection = "373b41"
let s:line = "282a2e"
View gist:5532074
//Colocar clase date-input
$(function(){
$('.date-input').attr('placeholder','AAAA-MM-DD').on('change', function(e){
var dt=$(this).val();
if(dt!='')
{
var da= dt.split('-');
var l = da.length;
if(l <= 3)
{
@dvidsilva
dvidsilva / Js Lambdas
Created May 8, 2013
Javascript functions are first class citizens just like any object, they can access the variables declared before them
View Js Lambdas
var makeCounter = function(){
var n=0;
return function(){
return n = n + 1;
}
}
var counter1 = makeCounter();
var counter2 = makeCounter();
View IdMovimiento
'130509073102086',
'130509074330010',
'1305090744295612',
'130509080848022',
'1305090810421758',
'1305090811531833',
'1305090812530248',
'130509081534082',
'130509081614057',
'130509081703015',
View Form Pagos Online
<form method="post" action="https://gateway.pagosonline.net/apps/gateway/index.html" id="pagosonline_form" name="pagosonline_form">
<input type="hidden" name="descripcion" value="{$p.gtitle|stripslashes}" />
<input type="hidden" name="valor" value="{$value[1]}" id='povalue'/>
<input type="hidden" name="usuarioId" value="{$login}" />
<input type="hidden" name="moneda" value="COP" />
<input name="lng" type="hidden" value="es">
<input name="iva" type="hidden" value="0.00">
<input name="baseDevolucionIva" type="hidden" value="0.00">
<input type="hidden" name="emailComprador" value="{$emailcomprador}" />
<input type="hidden" name="url_respuesta" value="{$baseurl}/thank_you?g={$eid}" /> <!--Url where user is returned-->
View About freelancing
well, i'm bootstrapping, working and freelancing, afortunadamente no dependo del todo de la plata del freelancing porque making a living out of that es bien didicil, el article is an understatement, uno tiene que ir a eventos, conocer genre, etc….. ah, aparte, te pagan cuando se les da la gana, si acaso te pagan. dos veces que he trabajado a traves de freelancer.com no me pagaron si no solo el adelante… obvio ps no les di el codigo, pero te hace perder tiempo. También acá en colombia, te dicen hey necesito esto de afan, y te pagan cuando quieren.
si uno lo hace bien puede ganarse una buena liga, pero no es lo mío, por lo menos no para depender 100% de eso, es bueno tener trabajito en un sitio que no se atrasan en los pagos, que uno puede trabajar y comer tranquilizo y etc, y hacer plata extra como freelance para poder comprar magicmouse o cosas adicionales
You can’t perform that action at this time.