Skip to content

Instantly share code, notes, and snippets.

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

Oskar oskarrough

💭
██████
View GitHub Profile
@brendanoh
brendanoh / controller.js
Last active March 5, 2017 21:07
This is a GIST to explain a workaround to the lack of case insensitive or partial text search on the server side via the Emberfire add-on.
import Ember from 'ember';
import computed from 'ember-new-computed';
const inject = Ember.inject;
const alias = computed.alias;
const sort = computed.sort;
export default Ember.Controller.extend({
sessionManager: inject.service(),
person: alias('sessionManager.person'),
@elithrar
elithrar / history.js
Last active January 10, 2016 14:03
smartScroll for Ember.js - reset the scroll position on forward transitions you haven't previously visited - via @rwjblue on embercommunity.slack.com
// app/locations/history.js
export default Ember.HistoryLocation.extend({
pushState() {
this._super(...arguments);
window.scrollTo(0, 0);
}
});
```​
@sebz
sebz / grunt-hugo-lunrjs.md
Last active April 29, 2024 16:44
hugo + gruntjs + lunrjs = <3 search
@paulirish
paulirish / bling.js
Last active May 1, 2024 19:56
bling dot js
/* bling.js */
window.$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function (name, fn) {
this.addEventListener(name, fn);
}
NodeList.prototype.__proto__ = Array.prototype;

Scrolleo

Apple has been creating some amazing scrolling video sites lately and I've been trying to create a simplified plugin to recreate this effect. This is the alpha version of this plugin. You can see an example of the effect I'm recreating here: http://www.apple.com/macbook/

This uses requestAnimationFrame and allows you to create multiple custom scrolling videos easily.

A Pen by Mark Teater on CodePen.

License.

@n370
n370 / 20150309_firebase_batch_push.md
Last active June 21, 2020 19:57
Using jq, HTTPie and the Firebase REST API to push JSON objects from your terminal.

Using jq, HTTPie and the Firebase REST API to push JSON objects from your terminal.

Imagine a scenario where you've been developing locally with dummy data and at some point decided to move this data to a Firebase instance.

Assuming your JSON file contents looks like the following.

[ 
  {
    "name": "Zapallo Anco",
@NuckChorris
NuckChorris / array.js
Last active February 12, 2018 19:47 — forked from pixelhandler/transforms.js
In Ember-CLI, transforms are located in app/transforms/name.js
// app/transforms/array.js
import Ember from 'ember';
import DS from 'ember-data';
export default DS.Transform.extend({
deserialize: function(value) {
if (Ember.isArray(value)) {
return Ember.A(value);
} else {
return Ember.A();
/**
* How to:
* $('div.container').imagesLoaded(function(){console.log('all images loaded in .container');});
* In case you need to support IE8, you need to use HTML5shiv **and** need to modify jQuery the following way:
* https://github.com/jquery/jquery/commit/a9533893b9e5e9a248139f5794c5d6099382cf14
*/
(function($){
'use strict';
$.fn.imagesLoaded = (function(){
var imageLoaded = function (img, cb, delay){
@tim-evans
tim-evans / document_title.js
Created August 22, 2014 19:28
Document title mixin for Ember.Router
import Ember from "ember";
var get = Ember.get;
var copy = Ember.copy;
var removeObserver = Ember.removeObserver;
var addObserver = Ember.addObserver;
var DocumentTitleMixin = Ember.Mixin.create({
titleTokensDidChange: function () {