Skip to content

Instantly share code, notes, and snippets.

import { Observable } from 'rxjs/Observable';
import 'rxjs/add/observable/fromEvent';
import 'rxjs/add/operator/filter';
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/combineLatest';
import 'rxjs/add/operator/distinctUntilChanged';
import 'rxjs/add/operator/takeUntil';
/**
* I am learning rxjs. The most complicated part is understanding the
@bcardarella
bcardarella / fastboot-deplo.md
Created July 3, 2016 22:54
How to deploy an ember fastboot app

App Setup

  1. ssh into server
  2. git clone the repo
  3. Configure {nginx,apache,etc} to forward requests to the fastboot server
  4. Configure {nginx,apache,etc} to fallback to static assets if fastboot is not available

App updates

  1. ssh into server
@LAMike310
LAMike310 / getVideos.js
Created March 26, 2016 20:18
Get all videos from a YouTube channel
var axios = require('axios')
var Firebase = require('firebase')
var nextPageToken = ''
// Get the YT Channel Playlist ID from here:
// https://www.googleapis.com/youtube/v3/channels?part=contentDetails&forUsername={YOUTUBE_CHANNEL_NAME}&key={YOUR_API_KEY}
function saveVideoData(token) {
var ROOT_URL = "https://www.googleapis.com/youtube/v3/playlistItems?pageToken=" + nextPageToken + "&part=snippet&playlistId=UUzQUP1qoWDoEbmsQxvdjxgQ&key={YOUR_API_KEY}&maxResults=50&?"
axios.get(ROOT_URL)
.then(function (response) {
data = response.data;
@imcarvalho
imcarvalho / install_php_extensions_mac_mamp.md
Last active May 10, 2018 10:46
Install extensions on MAMP 3.5 and Mac OSX 10.11 tutorial

I'm using PHP 5.6.10, and trying to install the memcache extension. You can adapt this to other PHP versions and to other extensions, of course 😄

  • Download the version of PHP you're using from php.net.
  • At /Applications/MAMP/bin/php/php5.6.10, create a directory named include.
  • Inside /Applications/MAMP/bin/php/php5.6.10/include (your newly created folder), untar the php file you downloaded from php.net.
  • For me, it produced a folder named "php-5.6.10". Rename it to "php". Now you'll have this structure: /Applications/MAMP/bin/php/php5.6.10/include/php
  • Go to that folder on terminal, and run ./configure
  • Then, go to /Applications/MAMP/bin/php/php5.6.10/include/php/bin
  • Run, for instance: sudo /Applications/MAMP/bin/php/php5.6.10/bin/pecl install memcache
  • Afterwards, edit your php.ini file (/Applications/MAMP/bin/php/php5.6.10/conf/php.ini), and add the line extension=memcache.so
@inexorabletash
inexorabletash / @ Indexed DB URLs via Service Workers.md
Last active December 20, 2023 01:29
Indexed DB URLs via Service Workers

URLs into Indexed DB, via Service Workers

Let's say you're using Indexed DB for the offline data store for a catalog. One of the object stores contains product images. Wouldn't it be great if you could just have something like this in your catalog page?

<img src="indexeddb/database/store/id">

HTML5 Audio Player w/ Responsive Playlist

I changed this!

This is an HTML5 audio player that detects the user agent of your device/browser/OS and applies styling that matches the native audio player. The playlist responds to the width of your screen and features basic UI controls.

Feel free to fork this pen and add your own user agent styles for different browsers, devices and operating systems.

@addyosmani
addyosmani / package.json
Last active January 18, 2024 21:31
npm run-scripts boilerplate
{
"name": "my-app",
"version": "1.0.0",
"description": "My test app",
"main": "src/js/index.js",
"scripts": {
"jshint:dist": "jshint src/js/*.js",
"jshint": "npm run jshint:dist",
"jscs": "jscs src/*.js",
"browserify": "browserify -s Validating -o ./dist/js/build.js ./lib/index.js",
@weberste
weberste / gist:354a3f0a9ea58e0ea0de
Last active January 28, 2022 13:47
Dates only with Angular-UI Bootstrap datepicker
app.directive('datepickerLocaldate', ['$parse', function ($parse) {
var directive = {
restrict: 'A',
require: ['ngModel'],
link: link
};
return directive;
function link(scope, element, attr, ctrls) {
var ngModelController = ctrls[0];