Skip to content

Instantly share code, notes, and snippets.

💭
I may be slow to respond.

Camilo Aguilar c4milo

💭
I may be slow to respond.
Block or report user

Report or block c4milo

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:5c94d367d86d3137f8bbbd0df662033b
### Keybase proof
I hereby claim:
* I am c4milo on github.
* I am c4milo (https://keybase.io/c4milo) on keybase.
* I have a public key ASANtMIZIWn4tKekhNXgVvegPHByOhtnIR5udnqT0E0lFgo
To claim this, I am signing this object:
View nomad-centos7.bash
# this is a bag of functions sourced by another script
if [[ $BASH_VERSINFO -lt "4" ]]; then
echo "!! Your system Bash is out of date: $BASH_VERSION"
echo "!! Please upgrade to Bash 4 or greater."
exit 2
fi
if [[ $EUID -ne 0 ]]; then
echo "!! This script must be run as root"
View getent-wrapper
#!/bin/sh
if [ "$1" == "initgroups" ]; then
echo "$2"
else
/usr/bin/getent1 "$@"
fi
View github_releases_issue.txt
c4milo at camilompb in ~/work/src/github.com/hooklift/lift on master [!]
$ curl --head -vvv https://github.com/lift-plugins/auth/releases/download/v1.2.2/auth_v1.2.2_darwin_amd64.sha512 --location
* Trying 192.30.253.113...
* TCP_NODELAY set
* Connected to github.com (192.30.253.113) port 443 (#0)
* TLS 1.2 connection using TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
* Server certificate: github.com
* Server certificate: DigiCert SHA2 Extended Validation Server CA
* Server certificate: DigiCert High Assurance EV Root CA
> HEAD /lift-plugins/auth/releases/download/v1.2.2/auth_v1.2.2_darwin_amd64.sha512 HTTP/1.1
@c4milo
c4milo / httpclient.go
Last active Aug 3, 2017
HTTP client with support for read and write timeouts which are missing in Go's standard library.
View httpclient.go
package httpclient
import (
"context"
"net"
"net/http"
"time"
)
// DialContextFn was defined to make code more readable.
View t.json
{
"list": {
"node": {
"id": "ubuntu",
"claimed": "true",
"class": "system",
"handle": "DMI:0001",
"description": "Project-Id-Version: lshwReport-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>POT-Creation-Date: 2009-10-08 14:02+0200PO-Revision-Date: 2012-10-07 14:34+0000Last-Translator: lumingzh <flywaterzh@gmail.com>Language-Team: Chinese (Simplified) <zh_CN@li.org>MIME-Version: 1.0Content-Type: text/plain; charset=UTF-8Content-Transfer-Encoding: 8bitX-Launchpad-Export-Date: 2014-07-07 12:12+0000X-Generator: Launchpad (build 17086)",
"product": "VMware Virtual Platform ()",
"vendor": "VMware, Inc.",
@c4milo
c4milo / component.js
Last active Jun 4, 2018
Simple breadcrumb Ember 2 component.
View component.js
import Ember from 'ember';
export default Ember.Component.extend({
tagName: '', // Does not let Ember inject HTML into the component.
routing: Ember.inject.service('-routing'),
breadcrumbs: Ember.computed('routing.currentRouteName', function () {
let routeName = this.get('routing.currentRouteName');
let routeNames = routeName.split('.');
let len = routeNames.length;
View breadcrumb.js
import Ember from 'ember';
export default Ember.Component.extend({
tagName: '', // Does not let Ember inject HTML into the component.
routing: Ember.inject.service('-routing'),
breadcrumbs: Ember.computed('routing.currentRouteName', function () {
console.log('--> current route: %s', this.get('routing.currentRouteName'));
Ember.getOwner(this).lookup('route:' + this.get('routing.currentRouteName')).label;
this.get('routing.router');
}),
View bsearch.go
package main
import "log"
var i int
func bsearch(target int, array []int) int {
low := 0
hi := len(array)
View gen-authors.sh
git log --pretty="format:%an %ae" | sort | uniq -i | sort | sed -e 's/^ *[0-9]* //g' > AUTHORS
You can’t perform that action at this time.