Skip to content

Instantly share code, notes, and snippets.

View armandocanals's full-sized avatar
👾
0_0

Armando Canals armandocanals

👾
0_0
View GitHub Profile
@armandocanals
armandocanals / react-copybutton.js
Last active April 5, 2019 06:26
Copy button using native browser range
import React from 'react';
class CopyButton extends React.Component {
constructor(props) {
super(props);
this.buttonText = props.buttonText;
this.copyText = props.textToCopy;
this.onCopied = this.onCopied.bind(this);
@armandocanals
armandocanals / fire-lentils.txt
Last active September 4, 2018 18:38
🔥Lentil Recipe
Lentil Recipe
1. Add Lentils and Chicken Broth + Water to large pot
(3-to-1 ratio of broth to lentils, more or less)
2. Put on stove on high with lentil/broth combo.
3. As the pot is heating up, prepare the following:
@armandocanals
armandocanals / vagrant-tips.md
Created January 31, 2017 11:45
Hanging HGFS Ubuntu 12.04 / Vagrant

Fix hanging HGFS: Read more here

echo "answer AUTO_KMODS_ENABLED yes" | sudo tee -a /etc/vmware-tools/locations
@armandocanals
armandocanals / baofeng.txt
Last active November 9, 2016 01:25
baofeng HAM setup: quick review
Turn the radio on
GO to menu item #40 and RESET the radio
Menu item #14 for either English voice or Voice OFF
Press EXIT on the keypad
Push orange VFO/MR button to go to Frequency mode and program in repeater frequency
Press MENU then push #1 for frequency stepping. 10K for ham repeater use.
Push #13 for CTCSS on transmit for repeater use.
Push #25 for repeater shift. Options are NEG(-) POS(+) or off for simplex
Item #26 for off shift repeater use. You want 00.600 for ham radio repeaters.
@armandocanals
armandocanals / largeSum.js
Created May 2, 2016 23:50
Sum Large Numbers in JavaScript
function add(num1, num2) {
num1 = num1.split('');
num2 = num2.split('');
num1 = num1.map(function (num) {
return parseInt(num, 10);
});
num2 = num2.map(function (num) {
return parseInt(num, 10);

GPG

Overview

packagecloud:enterprise uses GPG keys to sign repository metadata. You can let packagecloud:enterprise generate a GPG key itself during install or you can import an existing GPG key.

Read more about GPG, RPM packages, and yum repos.

#!/usr/bin/env ruby
require 'rubygems'
require 'json'
root = File.expand_path(ARGV[0] ? ARGV[0] : ".") + "/"
objectName = "JST"
templateDir = "templates/"
templates = Dir["#{root}#{templateDir}**/*.jst"]
contents = {}

Keybase proof

I hereby claim:

  • I am armandocanals on github.
  • I am armandocanals (https://keybase.io/armandocanals) on keybase.
  • I have a public key whose fingerprint is 285E E34A BF34 BB60 2B00 1577 BA60 4B0F 9E14 ADC5

To claim this, I am signing this object:

@armandocanals
armandocanals / micro-template.js
Last active August 29, 2015 14:02
Micro-templates based off underscore templates
template = function(text, data, translation) {
var matches = text.match(/\{\{([\s\S]+?)\}\}/g);
if (matches === null) { return text; }
if (translation !== undefined) {
for(key in translation) {
data[key] = translation[key];
}
}
- (void) drawCountdownSpinner {
int radius = 70;
CAShapeLayer *circle = [CAShapeLayer layer];
circle.path = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, 2.0*radius, 2.0*radius)
cornerRadius:radius].CGPath;
circle.position = CGPointMake(CGRectGetMidX(self.view.frame)-radius,
CGRectGetMidY(self.view.frame)-radius-40);