Skip to content

Instantly share code, notes, and snippets.

🙄
Contemplating why Github needs a status bar.

Gregg Pollack Gregg

🙄
Contemplating why Github needs a status bar.
Block or report user

Report or block Gregg

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
@Gregg
Gregg / timeout.js
Created Oct 11, 2018
Example of how to clear a timeout on beforeDestroy
View timeout.js
var Component = {
mounted() {
this.setTimeOutClose()
},
beforeDestroy() {
clearTimeout(this.timeout);
},
data() {
return {
timeout: null
@Gregg
Gregg / EventList.vue
Last active Aug 16, 2018
Axios Service
View EventList.vue
<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'
View index.html
<div id="app">
<h2>X are in stock.</h2>
</div>
<script>
var product = 'Boots'
</script>
View products.json
{
"products": [
{
"id": 1,
"name": "Compass",
"price": 2.35
},
{
"id": 2,
"name": "Jacket",
@Gregg
Gregg / Readme.txt
Created May 6, 2016
Angular 2 App Starting Point
View Readme.txt
Angular 2 challenge app
@Gregg
Gregg / gist:4979949
Last active Dec 13, 2015
Rails 4 Course Topics
View gist:4979949

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 Aug 14, 2012
missing challenge?
View something.rb
# before
def first_or_last_name
if user.first_name
user.first_name
else
user.last_name
end
end
# after
View gist:1660256
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 Dec 8, 2011
Sending two functions as parameters
View CoffeeScript.coffee
SendTwo(
->
alert 'thing 1'
->
alert 'thing 2'
)
You can’t perform that action at this time.