Skip to content

Instantly share code, notes, and snippets.

View abner's full-sized avatar

Ábner Silva de Oliveira abner

View GitHub Profile
@abner
abner / index.html
Last active April 14, 2017 13:17 — forked from anonymous/index.html
CycleJS with HttpDriver// source http://jsbin.com/vomumoj
<script src="http://cdn.jsdelivr.net/chartist.js/latest/chartist.min.js"></script>
<link href="http://cdn.jsdelivr.net/chartist.js/latest/chartist.min.css" rel="stylesheet" type="text/css" />
<!DOCTYPE html>
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/rxjs/4.0.6/rx.all.js"></script>
<script src="https://rawgit.com/cyclejs/cycle-core/v6.0.0/dist/cycle.js"></script>
<script src="https://rawgit.com/cyclejs/cycle-dom/v9.0.1/dist/cycle-dom.js"></script>
<script src="https://rawgit.com/cyclejs/cycle-http-driver/v7.0.0/dist/cycle-http-driver.min.js"></script>
<meta charset="utf-8">
@abner
abner / app.ts
Created January 11, 2017 14:10 — forked from lricoy/app.ts
Simple Angular2/Ionic2 auth
//TODO: Validar os operadores necessários para diminuir o tamanho
import 'rxjs/Rx';
import {App, Platform} from 'ionic-angular';
import {StatusBar} from 'ionic-native';
import {LoginPage} from './pages/login/login';
import {HttpClient} from "./common/providers/http";
@abner
abner / introrx.md
Created December 17, 2016 21:50 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@abner
abner / rxjs_operators_by_example.md
Created December 17, 2016 13:19 — forked from btroncone/rxjs_operators_by_example.md
RxJS 5 Operators By Example
@abner
abner / selinux-cheatsheet.md
Created November 23, 2016 19:19 — forked from Hellyna/selinux-cheatsheet.md
SELinux Cheatsheet

SELinux Cheatsheet

Change context: chcon

chcon -u 'something_u' -r 'something_r' -t 'something_t' file
chcon -R -u 'something_u' -r 'something_r' -t 'something_t' dir
chcon --reference 'file_with_target_context' file
chcon -R --reference 'file_with_target_context' dir

Restore context: restorecon

@abner
abner / index.ts
Created February 12, 2016 22:15 — forked from davideast/index.ts
Simple Angular 2 Forms with Firebase
import {bootstrap, Component, Decorator, View, If, For, EventEmitter} from 'angular2/angular2';
import {FormBuilder, Validators, FormDirectives, ControlGroup} from 'angular2/forms';
@Component({
selector: 'app',
injectables: [FormBuilder]
})
@View({
template: `
<div class="container" [control-group]="myForm">
@abner
abner / app myDirective.js
Last active December 7, 2015 15:29 — forked from vucalur/app myDirective.js
Yeoman - AngularJS : karma configuration for directives testing
// file: app/scripts/directives/myDirective.js
angular.module('someApp.directive').directive('myDirective', function () {
return {
templateUrl: 'templates/myDirective.html', // HERE
....
}
});
@abner
abner / angularjs_directive_attribute_explanation.md
Created October 25, 2015 07:31 — forked from CMCDragonkai/angularjs_directive_attribute_explanation.md
JS: AngularJS Directive Attribute Binding Explanation

AngularJS Directive Attribute Binding Explanation

When using directives, you often need to pass parameters to the directive. This can be done in several ways. The first 3 can be used whether scope is true or false. This is still a WIP, so validate for yourself.

  1. Raw Attribute Strings

    <div my-directive="some string" another-param="another string"></div>
@abner
abner / jasmine-this-vars.md
Created October 8, 2015 10:02 — forked from traviskaufman/jasmine-this-vars.md
Better Jasmine Tests With `this`

Better Jasmine Tests With this

On the Refinery29 Mobile Web Team, codenamed "Bicycle", all of our unit tests are written using Jasmine, an awesome BDD library written by Pivotal Labs. We recently switched how we set up data for tests from declaring and assigning to closures, to assigning properties to each test case's this object, and we've seen some awesome benefits from doing such.

The old way

Up until recently, a typical unit test for us looked something like this:

describe('views.Card', function() {
@abner
abner / grape.rake
Last active September 5, 2015 03:48 — forked from oivoodoo/routes.rake
rake task for printing grape routes.
namespace :grape do
desc "Grape API Routes"
task :routes => :environment do
mapped_prefix = '/api' # where mounted API in routes.rb
params_str = ' params:'
desc_limit = 45
route_info = Kanban::API.routes.map {|r| [r, r.instance_variable_get(:@options)] }
max_desc_size = route_info.map{|_,info| (info[:description] || '')[0..desc_limit].size }.max
max_method_size = route_info.map{|_,info| info[:method].size }.max
max_version_size = route_info.map{|_,info| info[:version].size }.max