Skip to content

Instantly share code, notes, and snippets.

Chris Seckler zeckdude

Block or report user

Report or block zeckdude

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
zeckdude / es7-async-await.js
Created Oct 13, 2018 — forked from msmfsd/es7-async-await.js
Javascript fetch JSON with ES7 Async Await
View es7-async-await.js
// Async/Await requirements: Latest Chrome/FF browser or Babel:
// Fetch requirements: Latest Chrome/FF browser or Github fetch polyfill:
// async function
async function fetchAsync () {
// await response of fetch call
let response = await fetch('');
// only proceed once promise is resolved
let data = await response.json();
// only proceed once second promise is resolved
View base 64
zeckdude / conditionalwrap.js
Created Aug 7, 2018 — forked from kitze/conditionalwrap.js
one-line React component for conditionally wrapping children
View conditionalwrap.js
import React from 'react';
const ConditionalWrap = ({condition, wrap, children}) => condition ? wrap(children) : children;
const Header = ({shouldLinkToHome}) => (
wrap={children => <a href="/">{children}</a>}
View help_with_backbone_views_events.js
// Handling events in a View
var SongView = Backbone.View.extend({
events: {
"click button": "onClick", // Run the "onClick" function when the any button is clicked
"click button.bookmark": "onClickBookmark", // Run the "onClickBookmark" function when the a button with the class "bookmark" is clicked
"click input[type=button]": "doSomething" // Shows that you can include the same types of selectors as in jQuery
onClick: function() {
console.log("Listen clicked");
zeckdude / backbone_from_scratch_chapter_collections.js
Created Dec 3, 2015
Backbone from Scratch Chapter Project: Collections
View backbone_from_scratch_chapter_collections.js
// Create a Backbone collection for the Vehicle model you created in the last project.
var Cars = Backbone.Collection.extend({
model: Vehicle
// Add the following cars inside the collection:
// * car1: { registrationNumber = “XLI887”, colour = “Blue” }
zeckdude / backbone_from_scratch_chapter_models.js
Last active Dec 3, 2015
Backbone from Scratch Chapter Project: Models
View backbone_from_scratch_chapter_models.js
console.log("Begin - BACKBONE MODELS PROJECT");
// Create a Backbone model for a Vehicle.
// A Vehicle is uniquely identified via one of its attributes called “registrationNumber”, which cannot be null or undefined.
// Vehicles can be retrieved from the server at “/api/vehicles”.
// A Vehicle should have a method called start(), which logs a message in the console: “Vehicle started.”
var Vehicle = Backbone.Model.extend({
idAttribute: "registrationNumber",
urlRoot: "/api/vehicles",
View Results
This says that when we visit http://you.rock/stringhelpers, we’ll initialize a basic string which will contain the text We like to program in PHP and we like to use the Laravel Framework! Then we’ll call our helper functions via static methods and var_dump the result to the screen.
string 'We like to program in PHP and we like to use the Laravel Framework!' (length=67)
string 'like to program in PHP and we like to use the Laravel Framework!' (length=64)
string 'We like to ' (length=11)
string 'like to program' (length=15)
zeckdude / CMailGunLogRoute.php
Created Jan 7, 2014
Extending Yii CEmailLogRoute class using Mailgun
View CMailGunLogRoute.php
// components/CMailGunLogRoute.php
class CMailGunLogRoute extends CEmailLogRoute {
protected function sendEmail($email, $subject, $message) {
$mail = Yii::app()->mailgun->newMessage();
You can’t perform that action at this time.