Skip to content

Instantly share code, notes, and snippets.

View pasviegas's full-sized avatar

Pedro Antonio Souza Viegas pasviegas

  • São Paulo, SP, Brazil
View GitHub Profile
with import <nixpkgs> { };
let
formality = stdenv.mkDerivation {
name = "formality";
src = fetchFromGitHub {
owner = "moonad";
repo = "Formality";
rev = "7672090304ec1a5e83a4edb24d02a692620807b6";
with import <nixpkgs> { };
let
tla = stdenv.mkDerivation {
name = "tla";
src = fetchFromGitHub {
owner = "pmer";
repo = "tla-bin";
rev = "66c09caa79d1427418e703cf07a5ad7edc72bb96";
@pasviegas
pasviegas / gulpfile.js
Created May 3, 2017 12:26 — forked from Narigo/gulpfile.js
Cordova + React + Gulp + live reload
var gulp = require('gulp');
gulp.task('sass', sassCompile);
gulp.task('assets', assetCopy);
gulp.task('scripts', scriptCompile);
gulp.task('clean', clean);
gulp.task('prepareAndReload', ['prepare'], reloader);
gulp.task('prepare', ['default'], cordovaPrepare);
gulp.task('dev', ['default'], liveReloadServer);
import request from 'request';
export default async function (hook) {
const output = [hook.params.data.hook.changedTimesheetCompleteEntry].map((completeEntry) => {
return {
date: `${completeEntry.day}/${completeEntry.month}/${completeEntry.year}`,
sent: completeEntry.sent,
user: completeEntry.user,
forwardTo: completeEntry.forwardTo,
content: completeEntry.entryPairs.nodes.map((pair) => {
@pasviegas
pasviegas / MT.scala
Last active August 29, 2015 14:08 — forked from huitseeker/MT.scala
object MyApp{
trait ApplicativeFunctor[A, F[A]] {
def apply[X](a:X): F[X]
def map[B](f: A => B): F[B]
}
trait Monad[A, M[A]] extends ApplicativeFunctor[A, M] {
def flatMMap[B](f: A => M[B]): M[B]
}
(ns marsrover.core
(:require [clojure.string :as s]))
(defn add-tuple [fst snd]
[(+ (first fst) (first snd)) (+ (second fst) (second snd))])
(defn input->rovers [input]
(partition 2 (drop 1 (s/split-lines input))))
(defn next-movement [facing]
@pasviegas
pasviegas / core.clj
Created May 17, 2013 12:38
Reactor - Clojure
(ns reactor.clj.core
(:import [reactor.core Reactor Context]))
;;create the reactor
(def reactor (Reactor. (Context/rootDispatcher)))
;;create the selector
(def selector (reactor.Fn/$ "print.received"))
;;create and implement the consumer
(def consumer (proxy [reactor.fn.Consumer][] (accept [event] (println "Received"))))
@pasviegas
pasviegas / svphelper.java
Created April 9, 2013 12:44
svn bindings helper
package br.org.pav.svp.old;
import java.io.ByteArrayInputStream;
import java.io.File;
import org.tmatesoft.svn.core.SVNCommitInfo;
import org.tmatesoft.svn.core.SVNDepth;
import org.tmatesoft.svn.core.SVNErrorCode;
@pasviegas
pasviegas / svp.java
Created April 9, 2013 12:43
svn bindings
package br.org.pav.svp.old;
import java.io.File;
import java.io.IOException;
import org.tmatesoft.svn.core.SVNException;
import org.tmatesoft.svn.core.SVNNodeKind;
import org.tmatesoft.svn.core.SVNURL;
import org.tmatesoft.svn.core.io.ISVNEditor;
import org.tmatesoft.svn.core.io.SVNRepository;
- Doc ready function -o
- Functional setting -w
- Chainable -w
- Classy dom -w
- Selector engine -o
- Element transformation -w
- Event management -o
- Intelligent ajax -w
- Templating -o