Skip to content

Instantly share code, notes, and snippets.

View bschwartz757's full-sized avatar
🤠
Just hackin' away!

blake schwartz bschwartz757

🤠
Just hackin' away!
View GitHub Profile
@bschwartz757
bschwartz757 / profile.php
Created January 4, 2016 17:42
Gig Central gist
<?php
/**
* controllers/Profile.php
*
* Profile list page for Gig Central
*
* @package ITC260
* @subpackage Profile_list
* @author Doug Doner
* @version 1.0 2015/05/14
@bschwartz757
bschwartz757 / front-page.php
Created December 23, 2015 18:42
tww-fp-gist
<?php
/**
* Template Name: Home Page
*
* @package WordPress
* @subpackage TheWishingWellWA
* @since TheWishingWellWA 1.0
*/
?>
<?php get_header(); ?>
@bschwartz757
bschwartz757 / ci-news-controller-snippet.php
Created November 23, 2015 21:04
CodeIgniter News Controller for Annotation
<?php
//News.php
class News extends CI_Controller
{
public function __construct()
{
parent::__construct();
$this->load->model('news_model');
$this->config->set_item('banner', 'News Banner');
@bschwartz757
bschwartz757 / ci-rss-snippet.php
Created November 23, 2015 20:46
CodeIgniter Rss Snippet for Annotation
<?php
$this->load->view($this->config->item('theme') . 'header');
?>
<div id="main">
<?php foreach ($rss->channel->item as $rss_item): ?>
<h3><?php echo $rss_item->title ?></h3>
<div>
<?php echo $rss_item->description ?>
@bschwartz757
bschwartz757 / sweet-lo-layout-snippet.css
Last active April 9, 2017 23:04
Custom Layout Snippet for Annotation - Sweet Lo
@charset "utf-8";
/* CSS Document */
/* RESETS */
body, body * {
margin:0;
padding:0;
box-sizing: border-box; /* declared width = rendered width */
@bschwartz757
bschwartz757 / damn-right-layout-snippet.css
Last active April 9, 2017 23:05
Custom Layout Snippet for Annotation - DamnRight
@charset "utf-8";
/* CSS Document */
/* RESETS */
body, body * {
margin:0;
padding:0;
box-sizing: border-box; /* declared width = rendered width */
}
@bschwartz757
bschwartz757 / index.html
Created November 20, 2015 21:22
My portfolio page
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
@bschwartz757
bschwartz757 / solutions.js
Last active May 11, 2018 18:50
Parallel async function examples and string search examples
/////// FETCH URLS ASYNCHRONOUSLY ///////////
/* Client side, works in Chrome 55 and Firefox 52 without transpilation */
//https://blogs.msdn.microsoft.com/typescript/2016/11/08/typescript-2-1-rc-better-inference-async-functions-and-more/
//interesting (opinionated) article on fetch vs. xhr: https://jakearchibald.com/2015/thats-so-fetch/
async function fetchURLs() {
try {
// Promise.all() lets us coalesce multiple promises into a single super-promise
var data = await Promise.all([
/* Alternatively store each in an array */
// var [x, y, z] = await Promise.all([
@bschwartz757
bschwartz757 / strings.js
Last active May 11, 2018 18:50
String/RegExp search methods
<div id="placeholder">
Output goes here
</div>
const string = 'there is a cow in a field';
function print(result) {
console.log(result);
document.getElementById('placeholder')
.innerText = result;
@bschwartz757
bschwartz757 / async.js
Last active November 15, 2023 03:23
Async/await function to fetch data from multiple URLs in parallel
/* Client side, works in Chrome 55 and Firefox 52 without transpilation */
//https://blogs.msdn.microsoft.com/typescript/2016/11/08/typescript-2-1-rc-better-inference-async-functions-and-more/
async function fetchURLs() {
try {
// Promise.all() lets us coalesce multiple promises into a single super-promise
var data = await Promise.all([
/* Alternatively store each in an array */
// var [x, y, z] = await Promise.all([
// parse results as json; fetch data response has several reader methods available:
//.arrayBuffer()