View HalfSipHasher64.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Copyright (C) 2022 Felipe Oliveira Carvalho | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
View Sampling.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package rs.felipe.random | |
import java.util.Random | |
import scala.collection.mutable | |
import scala.collection.mutable.ArrayBuffer | |
object Sampling { | |
/** | |
* Randomly sample up to k items from a sequence. |
View union_find.ml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type 'a member = | |
{ mutable parent : 'a member | |
; mutable rank : int | |
; value : 'a | |
} | |
let make_set value = | |
let rec m = { parent = m; rank = 0; value } in | |
m | |
;; |
View SBTTestEngine.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
final class SBTTestEngine extends ArcanistUnitTestEngine { | |
const SBT_ROOT = 'services'; | |
public function getEngineConfigurationName() { | |
return 'sbt'; | |
} | |
protected function supportsRunAllTests() { |
View Sampling.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package m79.random | |
import java.util.Random | |
import scala.collection.mutable | |
import scala.collection.mutable.ArrayBuffer | |
object Sampling { | |
/** | |
* Randomly sample up to k items from a sequence. |
View btree.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* @flow */ | |
const KEY_KIND_STRING = 1; | |
const KEY_KIND_NUMBER = 2; | |
const KEY_KIND_BOOL = 3; | |
const KEY_KIND_RECORD = 4; | |
type KeyKind = 1 | 2 | 3 | 4; | |
class KeyValue<K, V> { | |
key: ?K; |
View HttpApiClient.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package m79.infra | |
import java.net.URI | |
import java.time.format.DateTimeFormatter | |
import m79.infra.HttpAPIClient.Call | |
import org.eclipse.jetty.client.HttpClient | |
import org.eclipse.jetty.client.api.{Request, Result} | |
import org.eclipse.jetty.client.util.{BufferingResponseListener, MultiPartContentProvider, StringContentProvider} | |
import org.eclipse.jetty.http.HttpMethod |
View build_cross_gcc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
set -e | |
trap 'previous_command=$this_command; this_command=$BASH_COMMAND' DEBUG | |
trap 'echo FAILED COMMAND: $previous_command' EXIT | |
#------------------------------------------------------------------------------------------- | |
# This script will download packages for, configure, build and install a GCC cross-compiler. | |
# Customize the variables (INSTALL_PATH, TARGET, etc.) to your liking before running. | |
# If you get an error and need to resume the script from some point in the middle, | |
# just delete/comment the preceding lines before running it again. |
View gist:299c0493757edb02a07f
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am philix on github. | |
* I am felipeoc (https://keybase.io/felipeoc) on keybase. | |
* I have a public key whose fingerprint is 966B E9AC DAD9 4616 ABC9 A3C8 0BBA AF18 42EB 67DC | |
To claim this, I am signing this object: |
View comprehension1.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val sixInts = List(1, 2, 3, 4, 5, 6) | |
for { | |
x <- sixInts | |
y <- sixInts | |
if x % 2 == 0 && y % 2 == 0 | |
} yield (x, y) |
NewerOlder