Skip to content

Instantly share code, notes, and snippets.

View andersr's full-sized avatar
😅
Focusing

Anders Ramsay andersr

😅
Focusing
View GitHub Profile
@andersr
andersr / index.html
Last active August 29, 2015 14:27 — forked from anonymous/index.html
JS Bin // source http://jsbin.com/kagaxusuho
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
@andersr
andersr / intro_to_meteor_js.md
Last active November 5, 2015 21:12
Meteor Resources
<nav class="navbar navbar-inverse">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">My Topics App</a>

Instructions for building this Meteor CRUD app, a basic app for teaching Meteor basics.

Step 0: Create app/basic dev setup

  • Run git clone [email protected]:andersr/meteor_crud from your terminal, followed by cd meteor_crud
  • Open the current directory in a text editor (eg using edit .)
  • (If you were creating this app from scratch, you would simply have typed meteor create app in this directory.)
  • Cd into the "app" directory and run meteor from the command line.
  • Open a browser window and enter the URL: http://localhost:3000
  • Leave this window open while building the app. Meteor will auto-refresh as you make changes.
  • Why have your app in an "app" sub-directory? Making your app a sub-directory of your working directory allows for making external files, such as config files, build files, etc, be part of your repo without being mixed in with actual app files.
LogdTags = {
getTags : function(str) {
var tags = [];
var hashTagPattern = /#[A-Za-z0-9_]*/gi;
tags = _.map(
// 1. find all matches for '#foo' in str
@andersr
andersr / gulp_4_warning.sh
Created August 13, 2016 15:20
Warning displayed when ending Gulp 4 script
[10:38:59] The following tasks did not complete: default, <parallel>, watch:styles, watch:views, browser-sync
[10:38:59] Did you forget to signal async completion?
@andersr
andersr / var_check.js
Created October 7, 2016 12:58
JS check if undeclared, undefined or null
//check if undeclared
try{
undeclaredVar
}
catch(e) {
if(e.name === 'ReferenceError') {
console.log('var is undeclared')
}
}
for (var i = 1; i <= 100; i++) {
if (i % 3 === 0 && i % 5 === 0) {
console.log('fizzbuzz')
} else if (i % 3 === 0) {
console.log('fizz')
} else if (i % 5 === 0) {
console.log('buzz')
}
}
const fetchJSON = url =>
fetch(url, { method: 'GET' })
.then(response => response.json())