Skip to content

Instantly share code, notes, and snippets.

View dbuarque's full-sized avatar

Dio Ianakiara dbuarque

View GitHub Profile
@dbuarque
dbuarque / graphql-go-mongodb-example.go
Created March 8, 2020 16:09 — forked from trunet/graphql-go-mongodb-example.go
Minimal example of GraphQL Golang and MongoDB playing nicely together. Edit
// Embedded in this article https://medium.com/p/c98e491015b6
package main
import (
"context"
"fmt"
"log"
"net/http"
"time"
@dbuarque
dbuarque / README.md
Created January 4, 2019 04:41 — forked from sullof/Eventron
A gist to run Eventron — an alternative to Tron Quickstart

Instructions

  1. Create docker-compose.yaml and up.sh on your computer
  2. Make up.sh executable (chmod +x ip.sh)
  3. Run ./up.sh

You can force pre-approval of proposals commenting/uncommenting variables in the section

    environment:
 - allowTvmTransferTrc10=1
@dbuarque
dbuarque / IDEX.sol
Created December 28, 2018 23:32 — forked from dominiek/IDEX.sol
IDEX Smart Contract
pragma solidity ^0.4.16;
contract Token {
bytes32 public standard;
bytes32 public name;
bytes32 public symbol;
uint256 public totalSupply;
uint8 public decimals;
bool public allowTransactions;
mapping (address => uint256) public balanceOf;
var StellarSdk = require('stellar-sdk');
StellarSdk.Network.useTestNetwork();
var server = new StellarSdk.Server('https://horizon-testnet.stellar.org');
var sourceAccountPair = StellarSdk.Keypair.random();
var destAccountPair = StellarSdk.Keypair.random();
var astroDollar1 = new StellarSdk.Asset('AstroDollar1', sourceAccountPair.publicKey());
@dbuarque
dbuarque / android_instructions.md
Created October 22, 2017 20:28 — forked from patrickhammond/android_instructions.md
Easily setup an Android development environment on a Mac

Here is a high level overview for what you need to do to get most of an Android environment setup and maintained.

Prerequisites (for Homebrew at a minimum, lots of other tools need these too):

  • XCode is installed (via the App Store)
  • XCode command line tools are installed (xcode-select --install will prompt up a dialog)
  • Java

Install Homebrew:

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

@dbuarque
dbuarque / slack_delete.rb
Created April 20, 2016 15:28 — forked from jamescmartinez/slack_delete.rb
This Ruby script will bulk remove all Slack files older than 30 days. Just add your API token from https://api.slack.com/web#authentication into the token quotes at the top of the file.
require 'net/http'
require 'json'
require 'uri'
@token = ''
def list_files
ts_to = (Time.now - 30 * 24 * 60 * 60).to_i # 30 days ago
params = {
token: @token,
@dbuarque
dbuarque / aws-sns-example.js
Created March 2, 2016 22:10 — forked from tmarshall/aws-sns-example.js
aws-sdk sns example, in Node.js
var AWS = require('aws-sdk');
AWS.config.update({
accessKeyId: '{AWS_KEY}',
secretAccessKey: '{AWS_SECRET}',
region: '{SNS_REGION}'
});
var sns = new AWS.SNS();

Getting Started with NPM (as a developer)

If you haven't already set your NPM author info, now you should:

npm set init.author.name "Your Name"
npm set init.author.email "[email protected]"
npm set init.author.url "http://yourblog.com"

npm adduser

require "open3"
# Helper for calling mongoimport utility
module MongoImport
include KoanHealth::Logging
MONGO_IMPORT_BIN = 'mongoimport'
DEFAULT_OPTIONS = {
format: :json,
header: false,
describe('e2e: main', function() {
var ptor;
beforeEach(function() {
browser.get('/');
ptor = protractor.getInstance();
});
it('should load the home page', function() {