Skip to content

Instantly share code, notes, and snippets.

View jefersondaniel's full-sized avatar

Jeferson Daniel jefersondaniel

View GitHub Profile
@jefersondaniel
jefersondaniel / angular-multiple-image-upload.js
Created August 14, 2015 01:17
ng multiple image uploader
angular.module(
'angularMultipleImageUpload',
[
'angularFileUpload'
]
)
.directive(
'ngMultipleImageUpload',
function() {
return {
@jefersondaniel
jefersondaniel / index.html
Last active August 29, 2015 14:28
Image Upload with Angular
<!DOCTYPE html>
<html>
<head>
<title></title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdn.rawgit.com/alexk111/ngImgCrop/master/compile/minified/ng-img-crop.css">
<style type="text/css">
.cropArea {
background: #E4E4E4;
overflow: hidden;
angular.module('angularSlideables', [])
.directive('slideable', function () {
return {
restrict:'C',
compile: function (element, attr) {
// wrap tag
var contents = element.html();
element.html('<div class="slideable_content" style="margin:0 !important; padding:0 !important" >' + contents + '</div>');
return function postLink(scope, element, attrs) {
@jefersondaniel
jefersondaniel / router.js
Created February 6, 2016 00:14
dumb-cyclejs-router
import {Observable} from 'rx';
function Intent (sources) {
return {
sources: sources,
changeLocation$: sources.History,
props$: sources.props$
};
}
# initialization file (not found)
@jefersondaniel
jefersondaniel / gist:3a86247defbe10da204be66779004b70
Created October 3, 2017 13:20
Install Vim 8 with Python, Python 3, Ruby and Lua support on Ubuntu 16.04
sudo apt-get remove --purge vim vim-runtime vim-gnome vim-tiny vim-gui-common
sudo apt-get install liblua5.1-dev luajit libluajit-5.1 python-dev ruby-dev libperl-dev libncurses5-dev libatk1.0-dev libx11-dev libxpm-dev libxt-dev
#Optional: so vim can be uninstalled again via `dpkg -r vim`
sudo apt-get install checkinstall
sudo rm -rf /usr/local/share/vim /usr/bin/vim
cd ~
@jefersondaniel
jefersondaniel / exemplo-promises.php
Created January 17, 2018 00:39
exemplo-promises.php
<?php
require __DIR__ . '/autoload.php';
use Amp\Loop;
@jefersondaniel
jefersondaniel / exemplo-promises.php
Last active February 6, 2018 23:42
Exemplo de código assíncrono com Amp
<?php
require __DIR__ . '/vendor/autoload.php';
use Amp\Loop;
from datetime import datetime, timedelta
actual_date = datetime(2018, 5, 8)
end_date = datetime(2018, 7, 18)
out = open('/tmp/daterange.txt', 'w')
while actual_date < end_date:
out.write(actual_date.strftime('%Y-%m-%d') + '\n')
actual_date = actual_date + timedelta(days=1)
@jefersondaniel
jefersondaniel / index.php
Created October 10, 2018 15:08
Php Spreadsheet Example
<?php
/**
* composer require phpoffice/phpspreadsheet "^1.3"
*/
require __DIR__ . '/vendor/autoload.php';
use PhpOffice\PhpSpreadsheet\Spreadsheet;
use PhpOffice\PhpSpreadsheet\Style\Alignment;