Skip to content

Instantly share code, notes, and snippets.

@g8d3
g8d3 / a.html
Last active January 5, 2017 16:22
qwe
navigator.serviceWorker.register('https://gist.githubusercontent.com/juanpastas/136c1b6381ac8f874c7084bf402b957c/raw/be873a06c05d00a17efb2b517e95d7341559e862/a.js');
Notification.requestPermission(function(result) {
if (result === 'granted') {
navigator.serviceWorker.ready.then(function(registration) {
registration.showNotification('Notification with ServiceWorker');
});
}
});

Problem:

  1. User loads page
  2. Precompiled JS and CSS are included
  3. CSS references wrong font URL

Solution:

  1. User loads page
  2. Precompiled JS and CSS are included
@g8d3
g8d3 / gist:7a91ab637a89d71c8a6290db594faddf
Created November 14, 2016 21:18
docco watch with livereload
ls prowriting.rb.md | entr docco prowriting.rb.md
livereloadx -s -p 3333
@g8d3
g8d3 / test.md
Created June 4, 2016 21:00
Test gist.io

Header 2

Some text.

@documents_by_category = Document.all.group_by{|doc| doc.category.name}
@g8d3
g8d3 / check by regexp
Last active December 30, 2015 06:52
some scripts for facebook auto poster from code canyon
$(':checkbox').map(function(i,e){if($(e).parent().text().match(/money|internet|opportu|marketing/i)) $(e).attr('checked', true);})
@g8d3
g8d3 / part 1
Created October 26, 2015 21:52
carrierwave duplicated folder
2015-10-26T21:40:17.116046+00:00 app[web.1]: [Rollbar] Error processing the payload: Encoding::UndefinedConversionError, "\xB5" from ASCII-8BIT to UTF-8. Payload: {"access_token"=>"97d7f0ef63e84359a5bfd26539fbf40e", "data"=>{:timestamp=>1445895616, :environment=>"production", :level=>"error", :language=>"ruby", :framework=>"Rails: 4.2.2", :server=>{:host=>"1634e801-3a2b-4e18-9227-0e91251517a0", :root=>"/app", :pid=>3}, :notifier=>{:name=>"rollbar-gem", :version=>"1.5.3"}, :body=>{:trace_chain=>[{:frames=>[{:filename=>"bin/rails", :lineno=>8, :method=>"<main>"}, {:filename=>"bin/rails", :lineno=>8, :method=>"require"}, {:filename=>"/app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.2/lib/rails/commands.rb", :lineno=>17, :method=>"<top (required)>"}, {:filename=>"/app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.2/lib/rails/commands/commands_tasks.rb", :lineno=>39, :method=>"run_command!"}, {:filename=>"/app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.2/lib/rails/commands/commands_tasks.rb", :lineno=>75, :method=>"se
@g8d3
g8d3 / -
Created August 20, 2015 04:37
notif problem
g log 56fa9d7efc62f5afaaf812f54448710847c915a8~..b766aa2d084d8ec3ae501fafc4b08e01d3139905 -p --grep noti
@g8d3
g8d3 / Learn MeteorJS properly curriculum.md
Last active August 29, 2015 14:27
From FB learn Meteor Properly

Start learning today. You can master Meteor in less than 1 month! Meteor is easy to learn if you know JavaScript, HTML and a bit of CSS. Create your first Meteor application and play with it. Go through all lessons in this curriculum and try to understand every lesson. Try to code your first Meteor app, share your code (Github repo) in this group and wait for feedback. The best way to learn is by doing.

Create Meteor application

t = Teacher.last
Notification.create user: t, thing: Content.last, message: 'last', url: '/'