Skip to content

Instantly share code, notes, and snippets.

View wallyqs's full-sized avatar
🌎

Waldemar Quevedo wallyqs

🌎
  • Synadia Communications, Inc.
  • San Francisco
  • X @wallyqs
View GitHub Profile
@wallyqs
wallyqs / fixing-wifi-in-ubuntu-14.04.org
Last active August 29, 2015 14:06
Fixing the wifi in Ubuntu 14.04 Lenovo Yoga 2

Problem most likely is that the wifi is hardware due to a bug, this can be checked with sudo rfkill list. The wlan module would say that it is Hardware Blocked.

  • Remaking the module, in the following repo there is a useful Makefile for this
sudo apt-get install linux-headers-generic build-essential git
git clone https://github.com/pfps/yoga-laptop.git
cd yoga-laptop/yoga_laptop
@wallyqs
wallyqs / about-org-macros.txt
Created September 24, 2014 05:39
macro implementation notes
#+macro: version 1.0
We have the application running version {{{version}}}.
Notice that it has to be within 3 brackets and no internal spaces.
#+macro: greet Hi $1, how is it going?
Now let's try saying hi: {{{greet(Wally)}}}.
#+macro: greetreply {{{greet($1)}}} - *$1* :: $2
@wallyqs
wallyqs / activate.el
Created October 8, 2014 20:24
activate org mode
(setq org-src-fontify-natively t)
(org-babel-do-load-languages
'org-babel-load-languages
'((emacs-lisp . t)
(R . t)
(C . t)
(sh . t)
(ruby . t)
(python . t)
(clojure . t)
@wallyqs
wallyqs / match-string.org
Created December 3, 2014 19:05
Using -Xprint:parser !
val FromToPattern = """(\d+)\.\.\.(\d+)""".r

val FromToPattern(from, to) = "111...222"

println(s"From: $from, To: $to")
@wallyqs
wallyqs / ruby-2.1.5-osx.md
Created February 12, 2015 11:58
ruby-2.1.5-in-os-x.md

To avoid compiling with clang:

export CC=/usr/bin/gcc-4.2
RUBY_CONFIGURE_OPTS="--with-setjmp-type=setjmp" rbenv install 2.1.5
@wallyqs
wallyqs / ob-rust-hack.el
Created April 27, 2015 08:51
ob-rust with play.rust-lang.org support
(require 'org)
(require 'url)
(require 'json)
(defvar url-http-end-of-headers)
(defvar url-http-response-status)
(defun org-babel-rust-request (method url &optional data)
"Returns a JSON object with the contents from the request"
@wallyqs
wallyqs / ob-eval.el
Created June 11, 2015 07:07
Still capture STDERR in ob-eval
(defun org-babel-eval (cmd body)
"Run CMD on BODY.
If CMD succeeds then return its results, otherwise display
STDERR with `org-babel-eval-error-notify'."
(let ((err-buff (get-buffer-create " *Org-Babel Error*")) exit-code)
(with-current-buffer err-buff (erase-buffer))
(with-temp-buffer
(insert body)
(setq exit-code
(org-babel--shell-command-on-region
¿Qué es ésyo?
@wallyqs
wallyqs / requests-stats.go
Last active September 13, 2015 18:37
Requests Stats in Golang NATS client
package main
import (
"fmt"
"time"
"runtime"
"github.com/nats-io/nats"
)
func main() {
from timeit import timeit
import re
# Source: http://stackoverflow.com/questions/4901523/whats-a-faster-operation-re-match-search-or-str-find
global cre
cre = re.compile("MSG")
def find(string, text):
if string.find(text) > -1: