Skip to content

Instantly share code, notes, and snippets.

@cesardeazevedo
cesardeazevedo / translate.hs
Created October 21, 2014 17:22
Helm Translate
{-
- Haskell experiment with functional reactive programming game engine Helm.
- just a basic square with x position and speed property, translating on the x axis.
-
- run:
- ghc translate.hs
- ./translate
-}
module Main where
@cesardeazevedo
cesardeazevedo / temperature-alert.sh
Created March 26, 2015 22:19
Just to notify me when my notebook is getting hot, my fan doesn't work, i have to blow manually...
# Just to notify me when my notebook is getting hot, my fan doesn't work, i have to blow manually...
maxTemp=85
while [ 1 ]
do
sensors=$(sensors -u)
PHYSICAL_TEMP1=$(echo "$sensors"| awk 'NR==13' | grep -Eo "\s[0-9]{2}")
@cesardeazevedo
cesardeazevedo / vimrc
Last active September 7, 2015 21:56
My vimrc
" Notes {
" Ben Hayden, Scott Blevins, Matt Thompson, et al. Public Domain.
" https://github.com/IntuitiveWebSolutions/VimConf
"}
" Basics {
set nocompatible " explicitly get out of vi-compatible mode
syntax on
if has('vim_starting')
set runtimepath+=~/.vim/bundle/neobundle.vim/
@cesardeazevedo
cesardeazevedo / vivo.rb
Created November 10, 2015 21:46
vivotransfer value
require 'Nokogiri'
require 'open-uri'
@doc = Nokogiri::HTML(open('http://www.vivotransfer.com/'))
@content = @doc.xpath('//p[@class = "valor"]').text
puts @content # => *R$ 5.550
puts @content.scan(/\d/).join # => 5550
@cesardeazevedo
cesardeazevedo / challengerBot.ls
Created February 13, 2016 03:49
Challenger Bot for PokerJS in livescript
global <<< require \prelude-ls
module.exports = ->
info =
name :\FXCesinha
email :\cesardeazevedo@outlook.com
btcWallet :\1R4VU1ag5xhsjXs6hbJ8fsCHi1CA3FBSs
ROYAL_FLUSH = 1000
@cesardeazevedo
cesardeazevedo / FSharpPostprocessor.cs
Created March 15, 2016 12:49
Unity3d F# AssetPostprocessor
using System.IO;
using UnityEngine;
using UnityEditor;
using UnityEditorInternal;
using System.Linq;
using System.Reflection;
/// <summary>
/// Rebuilds the Fsharp solution upon Fsharp source file changes.
/// Approach from IdrisUnityPlayground https://github.com/bamboo/IdrisUnityPlayground/blob/master/Assets/Editor/IdrisPostprocessor.cs
@cesardeazevedo
cesardeazevedo / blinktrade-rest.js
Created August 29, 2016 03:33
BlinkTradeJS API
var moment = require('moment');
var BlinkTradeRest = require('blinktrade').BlinkTradeRest;
var BlinkTrade = new BlinkTradeRest({
prod: true,
key: 'Ya8EkJ1kJSLyt5ZX60aWlmA7zPEgBqajt7UmvCZEvaA',
secret: 'xUS4e9hEl1RGpj4Fmh4KvQYKMWT2yItG9SGlDx4aYfo',
currency: 'BRL',
});
@cesardeazevedo
cesardeazevedo / authWebSocket.js
Created September 6, 2016 22:29
BlinkTradeJS Examples
var BlinkTradeWS = require('blinktrade').BlinkTradeWS;
var blinktrade = new BlinkTradeWS();
blinktrade.connect().then(function() {
return blinktrade.login({ username: 'rodrigo', password: 'abc12345' });
}).then(function(logged) {
console.log(logged);
}).catch(function(err) {
console.log(err);
@cesardeazevedo
cesardeazevedo / ramdaWherePropEq.js
Last active December 9, 2016 03:52
Ramda WhereEq only on predicate properties
var props = {
a: true,
b: true,
}
R.whereEq(props, {
a: true,
b: true,
}) // => true
import React, { Component } from 'react'
import {
Text,
View,
ScrollView,
Dimensions,
StyleSheet,
TouchableNativeFeedback,
} from 'react-native'