Skip to content

Instantly share code, notes, and snippets.

View Gregg's full-sized avatar
🙄
Contemplating why Github needs a status bar.

Gregg Pollack Gregg

🙄
Contemplating why Github needs a status bar.
View GitHub Profile
@Gregg
Gregg / timeout.js
Created October 11, 2018 14:53
Example of how to clear a timeout on beforeDestroy
var Component = {
mounted() {
this.setTimeOutClose()
},
beforeDestroy() {
clearTimeout(this.timeout);
},
data() {
return {
timeout: null
@Gregg
Gregg / EventList.vue
Last active August 16, 2018 15:09
Axios Service
<template>
<div>
<h1>Events Listing</h1>
<EventCard v-for="event in events" :key="event.id" :event="event"/>
</div>
</template>
<script>
import EventCard from '@/components/EventCard.vue'
import EventService from '@/services/EventService.js'
{"number":90210}
@Gregg
Gregg / index.html
Created December 15, 2017 16:15
Step 1
<div id="app">
<h2>X are in stock.</h2>
</div>
<script>
var product = 'Boots'
</script>
{
"products": [
{
"id": 1,
"name": "Compass",
"price": 2.35
},
{
"id": 2,
"name": "Jacket",
@Gregg
Gregg / Readme.txt
Created May 6, 2016 15:43
Angular 2 App Starting Point
Angular 2 challenge app
@Gregg
Gregg / gist:4979949
Last active December 13, 2015 21:48
Rails 4 Course Topics

Rails 4 Topics

Chapter 1

  • Ruby 1.9.3 and Whiny Nils.
  • ThreadSafety enabled in production.
  • Changes to match in routes.
  • Support for patch HTTP verb.
  • Route concerns
@Gregg
Gregg / something.rb
Created August 14, 2012 16:14
missing challenge?
# before
def first_or_last_name
if user.first_name
user.first_name
else
user.last_name
end
end
# after
traceroute to roadrunner.com (24.28.199.168), 64 hops max, 52 byte packets
1 10.49.144.1 (10.49.144.1) 8.724 ms 7.492 ms 20.726 ms
2 ten0-3-0.orld01-ser2.bhn.net (72.31.194.58) 7.393 ms 7.171 ms 5.984 ms
3 ten0-4-0-3.orld71-car2.bhn.net (71.44.61.98) 22.810 ms
ten0-1-0-5.orld71-car2.bhn.net (71.44.60.32) 10.923 ms
ten0-4-0-3.orld71-car2.bhn.net (71.44.61.98) 25.203 ms
4 ae1-0-orld71-cbr2.bhn.net (72.31.194.2) 23.625 ms 20.251 ms 8.188 ms
5 ae-3-10.cr1.atl20.tbone.rr.com (66.109.6.104) 16.863 ms
ae-4-11.cr1.atl20.tbone.rr.com (66.109.10.14) 14.893 ms
ae-3-10.cr1.atl20.tbone.rr.com (66.109.6.104) 15.780 ms
@Gregg
Gregg / CoffeeScript.coffee
Created December 8, 2011 15:26
Sending two functions as parameters
SendTwo(
->
alert 'thing 1'
->
alert 'thing 2'
)