Skip to content

Instantly share code, notes, and snippets.

View Danjavia's full-sized avatar

Danny Viasus Danjavia

  • Bogota - Colombia
View GitHub Profile
@Danjavia
Danjavia / 0_reuse_code.js
Created November 12, 2013 15:18
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@Danjavia
Danjavia / key generator
Created November 12, 2013 15:20
Generate A random key
// Serial Key Generator
$pool = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
$countPool = count( $pool ) ;
$totalChars = 12 ;
$pass = '' ;
for ( $i = 0 ; $i < $totalChars ; $i++ ) {
$currIndex = mt_rand( 0, $countPool ) ;
$currChar = $pool[ $currIndex ] ;
$pass .= $currChar ;
@Danjavia
Danjavia / thumbnail_source.php
Created November 14, 2013 03:54
Use to obtain the thumbnail source
# Use to extract thumbnail source
$foto = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'medium' );
$src = $foto['0'];
@Danjavia
Danjavia / new_gist_file
Created November 14, 2013 22:38
tooltip for bootstrap
<div class="tooltip">
<div class="tooltip-inner">
Tooltip!
</div>
<div class="tooltip-arrow"></div>
</div>
@Danjavia
Danjavia / validator
Created November 20, 2013 22:55
validator
if ( $_SERVER[ 'REMOTE_ADDR' ] === '190.85.117.53' ){
var_dump( $wp_query, get_the_ID() );
}
@Danjavia
Danjavia / postype generator.php
Created November 28, 2013 02:30
use to create postypes is necessary revision
<?php
$functions_file = 'postypes.php';
$names = array( 'Photos', 'Gallery', 'Catalog' );
$function = '
<?php
function pulsar_postypes() {
';
# Remove cached repository in order to .gitignore to take effect after
# several commit have been made.
git rm -r --cached .
git add .
git commit -m "Removed cached repository, now .gitignore should work fine."
/* Pre-Define HTML5 Elements in IE */
(function(){ var els = "source|address|article|aside|audio|canvas|command|datalist|details|dialog|figure|figcaption|footer|header|hgroup|keygen|mark|meter|menu|nav|picture|progress|ruby|section|time|video".split('|'); for(var i = 0; i < els.length; i++) { document.createElement(els[i]); } } )();
@Danjavia
Danjavia / Procfile
Last active August 29, 2015 14:11 — forked from facultymatt/Procfile
web: node server
@Danjavia
Danjavia / styles-firefox-only.less
Last active July 13, 2016 16:45
Apply styles for firefox only
@-moz-document url-prefix() {
.select-wrapper {
&:after {
display: none;
}
}
}