Skip to content

Instantly share code, notes, and snippets.

@travi5567
travi5567 / html
Created Jan 22, 2013
Html: template
View html
<!DOCTYPE html>
<html>
<head>
<title>Title of Page</title>
<link rel="stylesheet" type="text/css" href="css/screen.css">
<script type="text/javascript" src="js/jquery.js"></script>
</head>
<body>
<div class="container">
@travi5567
travi5567 / get_model.php
Last active Dec 11, 2015
PHP: order,select,get return DATABASE_MODEL
View get_model.php
<?php
class Workouts_model extends CI_Model {
function getData() {
$this->db->order_by('id', 'DESC');
$this->db->select('id, arms, chest, legs, abbs, back');
$q = $this->db->get('workouts');
if($q->num_rows() > 0) {
View WORDPRESS: The_loop
http://codex.wordpress.org/The_Loop
------------------------------------------------------------------------------
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<?php endwhile; else: ?>
<p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
<?php endif; ?>
View PHP: foreach loop
<?php
foreach($arrayVariable as $variable){
echo $variable;
}
@travi5567
travi5567 / gist:4702608
Created Feb 3, 2013
JQUERY: Document.ready script block
View gist:4702608
<script type="text/javascript">
$(function () {
});
</script>
View flexbox.less
// --------------------------------------------------
// Flexbox LESS mixins
// The spec: http://www.w3.org/TR/css3-flexbox
// --------------------------------------------------
// Flexbox display
// flex or inline-flex
.flex-display(@display: flex) {
display: ~"-webkit-@{display}";
display: ~"-moz-@{display}";