Skip to content

Instantly share code, notes, and snippets.

View oskarrough's full-sized avatar
💭
██████

Oskar oskarrough

💭
██████
View GitHub Profile
@Heydon
Heydon / observe.js
Last active December 18, 2020 11:52
// Elements with `data-observe` toggle `data-visible`
// between `true` and `false`
if ('IntersectionObserver' in window) {
const callback = (entries, observer) => {
entries.forEach(entry => {
entry.target.setAttribute('data-visible', entry.isIntersecting)
})
}
@mupkoo
mupkoo / .gitlab-ci.yml
Created August 22, 2017 08:07
Using Ember-CLI with Chrome on GitLab CI
image: node:7.10
cache:
paths:
- node_modules/
- bower_components/
before_script:
# Install Chrome
- wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
@Rich-Harris
Rich-Harris / README.md
Last active July 28, 2017 13:24
Bare imports in manifest

A hastily-written strawman for how bare imports could be resolved in browsers — see this convo.

FROM ruby:2.3.3
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs
RUN mkdir /app
WORKDIR /app
ADD Gemfile /app/Gemfile
ADD Gemfile.lock /app/Gemfile.lock
RUN bundle install
ADD . /app
EXPOSE 3000
CMD rails s -p 3000
@simurai
simurai / README.md
Last active November 28, 2019 05:39
Atom for minimalists

For minimalist ❤️ ers

minimalist

Just you, your code and nothing else.... :meditatingbuddha:

@toranb
toranb / app-layout.component.js
Last active January 5, 2017 20:34
MasterDetailYieldedEach
import Ember from 'ember';
import hbs from 'htmlbars-inline-precompile';
export default Ember.Component.extend({
layout: hbs`
{{yield}}
`
});
@addyosmani
addyosmani / ember-serviceworker.md
Last active January 15, 2023 11:16
Ember Service Worker support

Ember.js currently doesn't have baked in support for Service Worker. They want this and there's an ember-cli RFCS thread discussing strategies however a number of tooling efforts exist to help fill in this gap today.

Note: you can of course just write vanilla Service Worker code for your Ember.js apps and that will work just fine. This doc tracks tooling and libraries that lower the friction for getting this setup

Service Worker Libraries

These static resource precaching and runtime caching libraries are lower-level than Broccoli, but can be used directly

@steven-ferguson
steven-ferguson / firebase-ui-auth.js
Created July 12, 2016 23:59
Emberfire + FirebaseUI Authentication
/* globals firebaseui */
import Ember from 'ember';
import firebase from 'firebase';
const { computed, inject: { service } } = Ember;
export default Ember.Component.extend({
firebaseApp: service(),
didInsertElement() {
@rugk
rugk / README.md
Created June 16, 2016 20:31
Create Link headers for HTTP/2 Server push

This script creates headers of all files in a given directory to use them for HTTP/2 server push.

Usage: linkheader.sh /mydir

@planetcrypton
planetcrypton / text-2-html-test.js
Last active February 22, 2016 08:55
Ember JS Helper for converting parts of a text (non-mark-down) to HTML whenever certain patterns are recognized
/**
* $ ember test --filter "text-2-html"
*/
import { text2Html } from '../../../helpers/text-2-html';
import { module, test } from 'qunit';
module('Unit | Helper | text 2 html');
const input = "Hey\nHow're ya doin'?\nSorry you can't get through.\nWhy don't you leave me your name, mine is @planetcrypton, and your number, mine is +4512345678, and I'll get back to you.\nDon't forget to visit http://www.wearedelasoul.com/\nMail me at plug2@reversed-yogurt.com #oldschool #plug1 #plug2 #plug3";