Skip to content

Instantly share code, notes, and snippets.

View agrcrobles's full-sized avatar

Garcia agrcrobles

  • Barcelona
View GitHub Profile
@stephenweinrich
stephenweinrich / environment.tf
Last active January 3, 2019 14:55
terraform azure configuration
variable "subscription_id" {}
variable "client_id" {}
variable "client_secret" {}
variable "tenant_id" {}
variable "environment" {}
# Configure the Azure Provider
provider "azurerm" {
subscription_id = "${var.subscription_id}"
client_id = "${var.client_id}"
@stefanbemelmans
stefanbemelmans / Addresses.sol
Created June 6, 2018 05:10
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.24+commit.e67f0147.js&optimize=false&gist=
pragma solidity ^0.4.0;
/*
Copyright (c) 2018 HERC SEZC
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
@stefanbemelmans
stefanbemelmans / Addresses.sol
Created May 22, 2018 04:26
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.24+commit.e67f0147.js&optimize=false&gist=
pragma solidity ^0.4.0;
/*
Copyright (c) 2018 HERC SEZC
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

Strings

String.prototype.*

None of the string methods modify this – they always return fresh strings.

  • charAt(pos: number): string ES1

    Returns the character at index pos, as a string (JavaScript does not have a datatype for characters). str[i] is equivalent to str.charAt(i) and more concise (caveat: may not work on old engines).

@skabbes
skabbes / README.md
Last active May 5, 2021 20:57
react-navigation with react-native web webpack config

These files aren't complete, but they are plucked out from a successful (closed-source) usage of react-navigation 1.5.8 with react-native-web@latest.

While a blog post would be nice when I have a minute free, I'd like to give this to someone who wants to give it a try before I do.

class Swipe {
static swipeRight(selector) {
if (!selector) {
browser.touchAction([{action: 'press', x: 0, y: 100}, {action: 'moveTo', x: 200, y: 100}, 'release']);
} else {
let startX = $(selector).getLocation().x;
let endX = startX + 200;
let y = $(selector).getLocation().y;
@trueadm
trueadm / adopt-syntax.js
Last active November 27, 2021 03:32
Adding a the "adopt" keyword to the JSX syntax
// I'm suggesting we add a new "adopt X from <Y />" syntax to the JSX language
// it would de-sugar to render prop children, but look and read better than
// what we currently have. For example:
// 1.
// this sugar
function MyComponent(props) {
adopt foo from <Bar />;
return <div>{foo}</div>;
}
@nebrius
nebrius / ibm-index-node-rpi.md
Last active February 22, 2018 22:12
Node.js + Raspberry Pi = Love IBM Index Talk Notes

Hardware list:

  • Ethernet cable
  • Thunderbolt ethernet adapter
  • USB power adapter
  • MiFi USB cable inverter for powering RPi
  • 2 x Micro USB B cables
  • 2 x Micro SD Cards
  • 2 x SD Card adapters
  • 2 x Raspberry Pi (2s)
const path = require('path');
const webpack = require('webpack');
const rootDirectory = path.resolve(__dirname, '../');
const appDirectory = path.resolve(__dirname, '../app');
// This is needed for webpack to compile JavaScript.
// Many OSS React Native packages are not compiled to ES5 before being
// published. If you depend on uncompiled packages they may cause webpack build
// errors. To fix this webpack can be configured to compile to the necessary
anonymous
anonymous / 1.js
Created February 1, 2018 18:45
function factorial(n){
if(n === 1 || n === 0){
return 1;
}
return factorial(n - 1) * n;
}
console.log(factorial(3)); // 3! = 6