Skip to content

Instantly share code, notes, and snippets.

View hr-service-2.ts
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import { BluetoothCore } from '@manekinekko/angular-web-bluetooth';
@Injectable()
export class HeartRateService {
static GATT_CHARACTERISTIC_HR_MEASUREMENT = 'heart_rate_measurement';
static GATT_PRIMARY_SERVICE = 'heart_rate';
View bball court
<svg id="shotChart-02-svg" style="height: 100%; width: 100%; overflow: visible;" preserveAspectRatio="xMinYMax meet" viewBox="0 0 590 120"><defs><radialGradient cx="0" cy="0" r="5" id="radialGradientSij1i6j9n2c"><stop offset="0%" stop-color="#d56900"></stop><stop offset="100%" stop-color="#000000"></stop></radialGradient><radialGradient cx="0" cy="0" r="5" id="radialGradientSij1i6j9n2t"><stop offset="0%" stop-color="#d56900"></stop><stop offset="100%" stop-color="#000000"></stop></radialGradient><radialGradient cx="0" cy="0" r="5" id="radialGradientSij1i6j9n3a"><stop offset="0%" stop-color="#d56900"></stop><stop offset="100%" stop-color="#000000"></stop></radialGradient><radialGradient cx="0" cy="0" r="5" id="radialGradientSj02pz5cnk"><stop offset="0%" stop-color="#d56900"></stop><stop offset="100%" stop-color="#000000"></stop></radialGradient><radialGradient cx="0" cy="0" r="5" id="radialGradientSj02pz5cnt"><stop offset="0%" stop-color="#d56900"></stop><stop offset="100%" stop-color="#000000"></stop></radial
View domhandler
import { Injectable } from '@angular/core';
@Injectable()
export class DomHandler {
public static zindex: number = 1000;
public addClass(element: any, className: string): void {
if (element.classList)
element.classList.add(className);
@xlozinguez
xlozinguez / SassMeister-input.scss
Created Jan 10, 2017 — forked from jlong/SassMeister-input.scss
Navigate a nested maps with map-fetch() in Sass
View SassMeister-input.scss
// ----
// Sass (v3.3.0.rc.2)
// Compass (v1.0.0.alpha.17)
// ----
//
// map-fetch($map, $keys)
//
// An easy way to fetch a deep value in a multi-level map. Works much like
// map-get() except that you pass multiple keys as the second parameter to
View company.api.service.spec.ts
import { TestBed, inject } from '@angular/core/testing';
import { FakeBackend } from 'ngx-http-test';
import { Observable } from 'rxjs/Observable';
import { CompanyApiService } from './company.api.service';
import { company_mock } from 'assets/mock-data/company.mock';
import { company_offices_mock } from 'assets/mock-data/company-offices.mock';
import { company_projects_mock } from 'assets/mock-data/company-projects.mock';
import { company_transactions_mock } from 'assets/mock-data/company-transactions.mock';
View 2017 Goals
Motto: The best way to learn is to teach
[ ] Master
[ ] Algorithms
[ ] ng2
[ ] TypeScript
[ ] RxJS / Redux
[ ] Teach
[ ] Publish 50 Blog entries
[ ] Lead 20 Lunch n Learn
View db.json
{
"stocks": [{
"id": 1,
"name": "Novavax NVAX",
"ticker": "NVAX"
}, {
"id": 2,
"name": "Array ARRY",
"ticker": "ARRY"
}, {
@xlozinguez
xlozinguez / api.js
Created Feb 26, 2016
Axial Events Express API
View api.js
var express = require('express');
var app = express();
app.use(express.bodyParser());
var events = [{
"id": 0,
"title": "Atlanta Summit 2016",
"date": "February 9th, 2016",
"img": "http://www.axial.net/wp-content/uploads/2015/12/Atlanta-Summit-hero-image.jpg"
}, {
View user_serializer
class UserSerializer < ActiveModel::Serializer
attributes :id,
:email,
:name,
:username,
:location,
:description,
:avatar_url,
:trainer_id,
:created_at,
@xlozinguez
xlozinguez / api_contoller.rb
Created Apr 11, 2013
This is the code to hook up an API controller within rails and handle authentication using devise/warden It also includes how to handle the admin role. NOTE: If the user is admin, when the user tries to access a user without the correct id, the system respond with an error. If the user is not an admin, when the user tries to access a user withou…
View api_contoller.rb
class Api::ApiController < ActionController::API
before_filter :user_authenticated?
private
def user_authenticated?
unless user_signed_in?
return render :status => 401, :json => {:success => false, :errors => ["Y U NO authenticated?"]}
end
end