Skip to content

Instantly share code, notes, and snippets.

View haskellcamargo's full-sized avatar
🪲
Everything is terrible

Marcelo Camargo haskellcamargo

🪲
Everything is terrible
View GitHub Profile
@haskellcamargo
haskellcamargo / turing.v
Created January 16, 2019 20:10 — forked from casperbp/turing.v
Coq implementation of a Turing Machine
(*** Turing Machines in Coq *)
(** Some preliminary types we'll use *)
CoInductive CoList (A: Type) := CONS (a:A) (t:CoList A) | NIL.
Arguments CONS [A] _ _.
Arguments NIL [A].
CoInductive Delay A := HERE (a:A) | LATER (_:Delay A).
import { __, reject, contains, either } from 'ramda'
const words = [
'oi', 'como', 'vai', 'você', 'seu', 'idiota'
]
const blacklist = [
'idiota', 'babaca', 'fdp'
]
@haskellcamargo
haskellcamargo / JSONParser.hs
Created July 4, 2016 23:21 — forked from zearen/JSONParser.hs
A simple haskell demonstation showing parsing JSON with Parsec
{-
Zachary Weaver <zaw6@pitt.edu>
JSONParser.hs
Version 0.1.1
A simple example of parsing JSON with Parsec in haskell. Note that
since the primary point of this excersize is demonstration,
Text.Parsec.Token was avoided to expose more of the grammar. Also,
complicated optimizations and shorcuts were avoided (mostly).
@haskellcamargo
haskellcamargo / gist:10210614de199710f8336db27b87eb54
Created May 24, 2016 20:59 — forked from ircmaxell/gist:1966809
Scalar Casting Patch, Version 3
Index: Zend/zend.h
===================================================================
--- Zend/zend.h (revision 323850)
+++ Zend/zend.h (working copy)
@@ -486,6 +486,10 @@
union _zend_function *__call;
union _zend_function *__callstatic;
union _zend_function *__tostring;
+ union _zend_function *__toint;
+ union _zend_function *__tofloat;
@haskellcamargo
haskellcamargo / Readme.md
Created February 16, 2016 13:00 — forked from gabrielemariotti/Readme.md
A SimpleSectionedRecyclerViewAdapter: use this class to realize a simple sectioned `RecyclerView.Adapter`.

You can use this class to realize a simple sectioned RecyclerView.Adapter without changing your code.

The RecyclerView should use a LinearLayoutManager. You can use this code also with the TwoWayView with the ListLayoutManager (https://github.com/lucasr/twoway-view)

This is a porting of the class SimpleSectionedListAdapter provided by Google

Screen

Example:

import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
public abstract class EndlessRecyclerOnScrollListener extends RecyclerView.OnScrollListener {
public static String TAG = EndlessRecyclerOnScrollListener.class.getSimpleName();
private int previousTotal = 0; // The total number of items in the dataset after the last load
private boolean loading = true; // True if we are still waiting for the last set of data to load.
private int visibleThreshold = 5; // The minimum amount of items to have below your current scroll position before loading more.
int firstVisibleItem, visibleItemCount, totalItemCount;
@haskellcamargo
haskellcamargo / README.md
Created November 27, 2015 19:31 — forked from polbins/README.md
Simple RecyclerView Divider

Simple RecyclerView Divider

Simple Horizontal Divider Item Decoration for RecyclerView

    mRecyclerView.addItemDecoration(new SimpleDividerItemDecoration(
            getApplicationContext()
    	));

NOTE: Add item decoration prior to setting the adapter

{
"cmd": ["java", "-jar", "C:\/TOTVS\/command_line_tools\/tdscli.jar", "-help"],
"encoding": "cp1252",
"variants": [
{
"cmd": ["java", "-jar", "C:\/TOTVS\/command_line_tools\/tdscli.jar", "compile",
"program=$file", "includes=C:\/ambientes_protheus\/M118_SQA_VALID2\/include",
"server=localhost", "port=25006", "environment=M118_SQA_VALID2", "serverType=Advpl",
"user=admin", "psw=",
/** Consider the interface
interface Mappable<A> {
map: (A → B) → Mappable<B>
}
*/
function Identity(value) {