Skip to content

Instantly share code, notes, and snippets.

View Denommus's full-sized avatar

Yuri Albuquerque Denommus

  • Brick Abode
  • Florianópolis, SC, Brazil
View GitHub Profile
@Denommus
Denommus / build.rs
Created June 15, 2019 14:50
I'm so proud of this build file.
extern crate bindgen;
extern crate cmake;
extern crate filetime;
use std::env;
use std::fs;
use filetime::FileTime;
fn generate_bindings(out_dir: &str) {
let ode_dir = format!("{}/build", out_dir);
@Denommus
Denommus / azureoverlay.nix
Created March 7, 2019 20:15
This file should be in `~/.config/nixpkgs/overlays`. This will fix nixopsUnstable
self: super: rec {
nixopsUnstable = super.nixopsUnstable.overrideAttrs (oldAttrs: {
preConfigure = ''
find . -iname azure_common.py -exec sed -i 's/NetworkResourceProviderClient/NetworkManagementClient/' {} \;
find . -iname azure_vm.py -exec sed -i 's/from azure.mgmt.network import PublicIpAddress, NetworkInterface, NetworkInterfaceIpConfiguration, IpAllocationMethod, PublicIpAddressDnsSettings, ResourceId/from azure.mgmt.network.models import PublicIPAddress, NetworkInterface, NetworkInterfaceIPConfiguration, IPAllocationMethod, PublicIPAddressDnsSettings\nfrom azure.mgmt.batchai.models import ResourceId/' {} \;
find . -iname azure_availability_set.py -exec sed -i 's/from azure.mgmt.compute import AvailabilitySet/from azure.mgmt.compute.models import AvailabilitySet/' {} \;
find . -iname azure_resource_group.py -exec sed -i 's/from azure.mgmt.resource import ResourceGroup/from azure.mgmt.resource.resources.models import ResourceGroup/' {} \;
find . -iname azure_storage.py
[0] % nixops deploy -d bawebsite-ec2
warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels/n
ixpkgs' does not exist, ignoring
error: value is null while a set was expected, at /nix/store/m0yxkvg915ws5z1yc
sblfx85nhf90p4b-nixpkgs-19.03pre161900.61c3169a0e1/nixpkgs/pkgs/top-level/defa
ult.nix:63:5
error: evaluation of the deployment specification failed
trait PrintError<E> {
fn print_err(self, message: &'static str) -> Self;
// The String type is allocated in the heap, so when a String is needed it's better to have a function that only allocates it in case it's necessary
fn print_err_with<F>(self, message_f: F) -> Self
where F: Fn(&E) -> String;
}
impl<T, E> PrintError<E> for Result<T, E> {
fn print_err(self, message: &'static str) -> Result<T, E> {
{
gitlab = { config, pkgs, ... }: {
deployment = {
targetEnv = "virtualbox";
virtualbox.memorySize = 1024;
virtualbox.vcpu = 2;
};
};
}
{
webserver = { config, pkgs, ... }: {
deployment = {
targetEnv = "virtualbox";
virtualbox.memorySize = 1024;
virtualbox.vcpu = 2;
};
};
}
import MyApp from './lib/js/re/myApp.js';
import { AppRegistry } from 'react-native';
AppRegistry.registerComponent('momirreason', () => MyApp);
open ReactErratique;
module type ReactModule = {
type t 'a;
let map: eq::('b => 'b => bool)? => ('a => 'b) => t 'a => t 'b;
let create: eq::(unit => unit => bool)? => unit => (t unit, step::step? => unit => unit);
};
module ComponentGenerator (R: ReactModule) => {
type action 'a =
@Denommus
Denommus / counterNew.re
Last active October 6, 2017 00:06
Integrating ReasonReact with Erratique's React
open ReactErratique;
let initial = ref 0;
let (timeS, timeC) = S.create !initial;
Js.log timeS;
let timeIncrement () => {
initial := !initial + 1;