Skip to content

Instantly share code, notes, and snippets.

View israeljrs's full-sized avatar

Israel Junior israeljrs

View GitHub Profile
@israeljrs
israeljrs / httpg.c
Created September 19, 2017 13:20
Exemplo de uso da libcurl.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <curl/curl.h>
size_t write_data(void *buffer, size_t size, size_t nmemb, void *userp)
{
return size *nmemb;
}
@israeljrs
israeljrs / CMakeLists.txt
Last active September 19, 2017 13:39
Exemplo de CMakeLists.txt para compilar a libcurl
cmake_minimum_required (VERSION 2.8.11)
project (HTTPG)
file(GLOB_RECURSE SOURCES src/*.c)
add_executable (httpg ${SOURCES})
set(EXECUTABLE_OUTPUT_PATH "bin")
find_package (CURL)
if (CURL_FOUND)
@israeljrs
israeljrs / cp1.directive.ts
Created September 19, 2017 20:00
sample use renderer2 with directive.
import { Directive, Renderer2, ElementRef, OnInit } from '@angular/core';
@Directive({
selector: '[appCp1]'
})
export class Cp1Directive implements OnInit {
constructor(private renderer: Renderer2, private el: ElementRef) { }
ngOnInit() {
@israeljrs
israeljrs / app.component.ts
Created September 19, 2017 20:04
sample renderer2 to app.
import { Component, ElementRef, Renderer2, ViewChild } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
})
export class AppComponent {
@ViewChild('myul')
@israeljrs
israeljrs / app.component.html
Created September 19, 2017 20:08
html of sample to renderer2
<h1>Sample usando Renderer 2</h1>
<ul #myul appCp1></ul>
<button (click)="onBtnClick()">Adiciona Item</button>
@israeljrs
israeljrs / styles.scss
Created September 20, 2017 20:14
sample file to scss angular material 2
/* You can add global styles to this file, and also import other style files */
@import url('https://fonts.googleapis.com/icon?family=Material+Icons');
@import '~@angular/material/prebuilt-themes/deeppurple-amber.css';
@import '~sweetalert2/dist/sweetalert2.css';
body {
margin: 0;
font-family: Roboto, sans-serif;
}
@israeljrs
israeljrs / app.module.ts
Created September 20, 2017 20:17
app.modules.ts to angular material 2
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { NgModule } from '@angular/core';
import { MdButtonModule, MdToolbarModule, MdCardModule, MdIconModule, MdMenuModule } from '@angular/material';
import { AppComponent } from './app.component';
@NgModule({
declarations: [
AppComponent
@israeljrs
israeljrs / app.component.ts
Created September 20, 2017 20:19
app.components.ts to angular material 2
import { Component } from '@angular/core';
import swal from 'sweetalert2';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
})
export class AppComponent {
title = 'app';
@israeljrs
israeljrs / app.component.html
Created September 20, 2017 20:22
app.components.html to angular material 2
<div class="container">
<md-toolbar color="primary">
<span>Material Design 2</span>
<button md-icon-button [md-menu-trigger-for]="menu">
<md-icon>account_circle</md-icon>
</button>
</md-toolbar>
<md-menu x-position="before" #menu="mdMenu">
<button md-menu-item>Entrar</button>
<button md-menu-item>Sobre</button>
@israeljrs
israeljrs / publish_angular_to_github.md
Created September 21, 2017 13:02
Como publicar uma pagina no github pages.

Publicando projetos angular no github page.

Para publicar um projeto no github pages basta seguir os passos abaixo.

  1. Primeiro crie na branch master um diretorio o nome de "/docs"
  2. altere a key outDir de public para docs
  3. faça o build do projeto.
  • ng build --prod --base-href "https://<user-name>.github.io/<repo>/"
  1. faça o push para o repositório no github.