Skip to content

Instantly share code, notes, and snippets.

Avatar

AJ Villalobos iamajvillalobos

View GitHub Profile
@iamajvillalobos
iamajvillalobos / gist:83f3b2140046bf1f45a6c2694467ee04
Created Mar 28, 2020
Install libv8 in Mac OS Catalina 10.15
View gist:83f3b2140046bf1f45a6c2694467ee04
$ brew install v8@3.15
$ bundle config build.libv8 --with-system-v8
$ bundle config build.therubyracer --with-v8-dir=$(brew --prefix v8@3.15)
$ bundle install
View gist:9872d83ab3839522fc2969084d85dc41
❯ bin/rails s
=> Booting Puma
=> Rails 6.0.2.1 application starting in development
=> Run `rails server --help` for more startup options
Puma starting in single mode...
* Version 4.3.1 (ruby 2.6.5-p114), codename: Mysterious Traveller
* Min threads: 5, max threads: 5
* Environment: development
* Listening on tcp://127.0.0.1:3000
* Listening on tcp://[::1]:3000
View gist:df61a7d22ba75dd18a3fe3e9cc19fa50
Add this on in settings.json
```
"editor.parameterHints": false,
```
View fetchAddressBalances.js
async function fetchAddressBalances() {
if (isFederatedAddress(address)) {
let xlmAddress = await fetchXLMAddressFromFederation(address);
if (xlmAddress.length > 0) {
let result = await fetchXLMAddressBalances(xlmAddress);
if (Array.isArray(result)) {
onButtonClick(result);
} else {
onError(result);
}
View package.json
"scripts": {
"predeploy": "npm run build",
"deploy": "gh-pages -d build"
},
View AddressCheckerButton.js
import React from "react";
import axios from "axios";
const STELLAR_API_URL = "https://horizon.stellar.org/accounts";
function AddressCheckerButton({ address, onButtonClick, onError }) {
function fetchAddressBalances() {
const url = `${STELLAR_API_URL}/${address}`;
axios
.get(url)
@iamajvillalobos
iamajvillalobos / text.rb
Last active Sep 18, 2018
Hello this is cool
View text.rb
class Text
def greet
puts "This is cool!"
end
end
@iamajvillalobos
iamajvillalobos / hello_vue.js
Created Aug 29, 2018
vuejs runtime vs compiler
View hello_vue.js
/* eslint no-console: 0 */
// Run this example by adding <%= javascript_pack_tag 'hello_vue' %> (and
// <%= stylesheet_pack_tag 'hello_vue' %> if you have styles in your component)
// to the head of your layout file,
// like app/views/layouts/application.html.erb.
// All it does is render <div>Hello Vue</div> at the bottom of the page.
import Vue from 'vue'
import App from '../app.vue'
@iamajvillalobos
iamajvillalobos / guide.md
Created Mar 19, 2018
How to signed your commits in GitHub using gpg
View guide.md
  1. Open https://github.com/settings/gpg/new in a new tab
  2. Install gpg-suite brew cask install gpg-suite
  3. Generate your gpg key gpg --full-generate-key NOTE: Enter 4096 for key size
  4. View your gpg keys with gpg --list-secret-keys --keyid-format Sample:
gpg --list-secret-keys --keyid-format LONG
/Users/hubot/.gnupg/secring.gpg
------------------------------------
sec   4096R/3AA5C34371567BD2 2016-03-10 [expires: 2017-03-10]
View gist:3e7e028db77543129486b6835858cc18
bin/rails test test/ --seed 9808 -n "/^(?:test_new_employees_sorts_specified_time))$/"