Skip to content

Instantly share code, notes, and snippets.


Anthony Delgado anthonydelgado

View GitHub Profile
View php
$fields = CFS()->get( 'sections' );
foreach ( $fields as $field ) { ?>
<div class="full-width bg-light-grey">
<div class="content-container content-section">
<div class="full-width-flex">
<div class="vh-container" style="background: url('<?php echo $field['image']; ?>') center no-repeat; background-size: cover">

How Dev Bootcamp Teaches: ActiveRecord

I'm Jesse, one of the co-founders of Dev Bootcamp, and the acting curricular editor-in-chief. We get lots of questions about how Dev Bootcamp approaches teaching, what our curriculum is like, and how it differs from other schools and competitors. I thought I'd share some of that with you, starting with a brief overview of our theory of learning and then sharing our introduction to ActiveRecord.

Update As of August, 2013, I'm no longer at Dev Bootcamp. I'm now working on CodeUnion to help people learn new technical skills without putting their lives on hold. I wrote everything below myself and I can't actually vouch for whether any of it reflects DBC's current approach. It definitely reflects our approach at CodeUnion, though. If you want to know more, please reach out: :)

This will be light on theory and hea

View slugify
//function to slugify a name
function slugify(text) {
return text.toString().toLowerCase()
.replace(/\s+/g, ‘-’) // Replace spaces with -
.replace(/[^\w\-]+/g, ‘’) // Remove all non-word chars
.replace(/\-\-+/g, ‘-’) // Replace multiple - with single -
.replace(/^-+/, ‘’) // Trim - from start of text
.replace(/-+$/, ‘’); // Trim - from end of text
anthonydelgado / heroku force https
Created Jul 2, 2017
Force SSL / HTTPS on heroku production server
View heroku force https
function requireHTTPS(req, res, next) {
// The 'x-forwarded-proto' check is for Heroku
if (! && req.get('x-forwarded-proto') !== 'https' && process.env.NODE_ENV == "production") {
return res.redirect('https://' + req.get('host') + req.url);
View giantuser_signature.html
<br />
<br />
<br />
<style type='text/css'>{margin:0;padding:0;border:none !important;text-decoration:none !important;}
table,tr,td,a,span{font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;}
<meta http-equiv='Content-Type' content='text/html; charset=UTF-8' />
<meta name='format-detection' content='telephone=no' />
View div.scroll
div.scroll {
background: url(../../assets/img/aems_website_banner_scroll.png) left no-repeat;
height: 64px;
width: 86px;
margin: 0 auto;
position: fixed;
bottom: 10%;
left: 50%;
margin-left: -43px;
z-index: 99112;
View constructor node
var Dud = function(gender, dudName, coolnessScale){
this.gender = gender
this.dudName = dudName;
this.coolnessScale = coolnessScale;
this.dudeOrDudess = function(){
if (this.gender == 'female'){
console.log("I'm a dudess. Sup?");
console.log("I'm a dude. Are there any dudesses around?");
View switch statement in node
var action = process.argv[2];
// We will then create a switch-case statement (if-then would also work).
// The switch-case will direct which function gets run.
case 'total':
case 'deposit':
View Native System UI Web Fonts
font-family: -apple-system, BlinkMacSystemFont,
"Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell",
"Fira Sans", "Droid Sans", "Helvetica Neue",
View Adding Emoji to your terminal
sublime ~/.bash_profile
Add this line
PS1="\W 🔥 "
Save and Exit
Restart Terminal