Skip to content

Instantly share code, notes, and snippets.

View iagocavalcante's full-sized avatar
🖥️
Happy coding again!

Iago Angelim Costa Cavalcante iagocavalcante

🖥️
Happy coding again!
View GitHub Profile
@iagocavalcante
iagocavalcante / rulething.html
Created January 11, 2017 18:21 — forked from mpj/rulething.html
Code from episode
<html>
<head>
<style>
.row div {
height: 8px;
display: inline-block;
width: 8px;
}
.row div.active {
background-color: red;
<?php defined('BASEPATH') OR exit('No direct script access allowed');
if( ! ini_get('date.timezone') )
{
date_default_timezone_set('GMT');
}
header('Access-Control-Allow-Origin: *');
class Dashboard extends CI_Controller{
public function __construct(){
parent::__construct();
$this->load->helper('form');
<?php include_once 'head.php';?>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<body id="home">
<header id="header">
<nav id="main-nav" class="navbar navbar-default navbar-fixed-top" role="banner">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
@iagocavalcante
iagocavalcante / index.php
Created February 15, 2017 03:59
Estudo Insights Facebook
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<script>
function showMetrics1(){
FB.api(
'/viladosilicio/insights/page_fans_country',
basicCSV = require("basic-csv"),
fs = require('fs'),
nt = require("natural");
var dic = [
"Homicídio", "Homicídio Qualificado", "Óbito",
"Comunicação de Homicídio", "Lesão Corporal Seguida de Morte", "Homicídio Doloso",
"Latrocínio", "Homicídio Simples", "Belém",
"Ananindeua", "Santarém", "Marabá",
"Castanhal", "Parauapebas", "Abaetetuba",
@iagocavalcante
iagocavalcante / nodejs-tcp-example.js
Created December 26, 2017 18:25 — forked from tedmiston/nodejs-tcp-example.js
Node.js TCP client and server example
/*
In the node.js intro tutorial (http://nodejs.org/), they show a basic tcp
server, but for some reason omit a client connecting to it. I added an
example at the bottom.
Save the following server in example.js:
*/
var net = require('net');
<template>
<div>
<v-card width="100%">
<v-card-title>
<h1>{{name}}</h1>
<v-spacer></v-spacer>
<v-text-field
append-icon="search"
label="Pesquisar"
@iagocavalcante
iagocavalcante / logger.js
Created July 10, 2018 19:57 — forked from luiguild/logger.js
Simple logger module and VuePlugin that check NODE_ENV to show console.log()
const prefix = process.env.PREFIX
const nodeEnv = process.env.NODE_ENV
let logCounter = 0
let errorCounter = 0
let fatalCounter = 0
let warnCounter = 0
export const vLogger = {
install (Vue, options) {
export const listen = (__statics) => {
const app = express()
app.use(bodyParser.json({ limit: '250mb' }));
app.use(bodyParser.urlencoded({ limit: '250mb', extended: true }));
app.use(cors())
app.use(express.static(path.join(__statics, 'videos')))
app.post('/api/download', async (req, res) => {
try {
import { app, BrowserWindow, ipcMain, autoUpdater, dialog } from 'electron'
import server from './server/server.js'
import fs from 'fs'
/**
* Set `__statics` path to static files in production;
* The reason we are setting it here is that the path needs to be evaluated at runtime
*/
if (process.env.PROD) {
global.__statics = require('path').join(__dirname, 'statics').replace(/\\/g, '\\\\')
}