Skip to content

Instantly share code, notes, and snippets.

@lasombra
lasombra / gist:983dbadfea0452e9611d95041e705a58
Created November 10, 2016 07:44 — forked from tonymtz/gist:714e73ccb79e21c4fc9c
Uninstall XQuartz.app from OSX Yosemite
launchctl unload /Library/LaunchAgents/org.macosforge.xquartz.startx.plist
sudo launchctl unload /Library/LaunchDaemons/org.macosforge.xquartz.privileged_startx.plist
sudo rm -rf /opt/X11* /Library/Launch*/org.macosforge.xquartz.* /Applications/Utilities/XQuartz.app /etc/*paths.d/*XQuartz
sudo pkgutil --forget org.macosforge.xquartz.pkg
# Log out and log in

I hereby claim:

  • I am lasombra on github.
  • I am lasombra (https://keybase.io/lasombra) on keybase.
  • I have a public key ASBsVgkFYLK1qKnU9GpxFTZJsE8DFu7IJOrTXXj84nk6Uwo

To claim this, I am signing this object:

{
@lasombra
lasombra / gitcheats.txt
Created March 29, 2016 15:22 — forked from chrismccoy/gitcheats.txt
git cheats
# shortform git commands
alias g='git'
# count relevant lines of shell code in a git repo
egrep -v '^\s*($|#)' $(git grep -l '#!/bin/.*sh' *) | wc -l
# push all remotes
for i in `git remote`; do git push $i; done;
# cherry pick range of commits, starting from the tip of 'master', into 'preview' branch
@lasombra
lasombra / web-servers.md
Created January 27, 2016 17:28 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
Verifying that +lasombra is my blockchain ID. https://onename.com/lasombra
@lasombra
lasombra / gist:2039351
Created March 14, 2012 20:40
Weechat on Lion with Xcode 4.3.1 complains about libintl.h
% brew install -v weechat
==> Downloading http://www.weechat.org/files/src/weechat-0.3.7.tar.bz2
File already downloaded in /Users/lasombra/Library/Caches/Homebrew
/usr/bin/tar xf /Users/lasombra/Library/Caches/Homebrew/weechat-0.3.7.tar.bz2
==> cmake -DPREFIX=/Users/lasombra/homebrew/Cellar/weechat/0.3.7 -DENABLE_RUBY=OFF -DENABLE_PERL=OFF -DENABLE_PYTHON=OFF -DCMAKE_INSTALL_PREFIX='/Users/lasombra/homebrew/Cellar/weechat/0.3.7' -DCMAKE_BUILD_TYPE=None -Wno-dev .
cmake -DPREFIX=/Users/lasombra/homebrew/Cellar/weechat/0.3.7 -DENABLE_RUBY=OFF -DENABLE_PERL=OFF -DENABLE_PYTHON=OFF -DCMAKE_INSTALL_PREFIX='/Users/lasombra/homebrew/Cellar/weechat/0.3.7' -DCMAKE_BUILD_TYPE=None -Wno-dev .
-- The C compiler identification is Clang
-- Check for working C compiler: /usr/bin/clang
-- Check for working C compiler: /usr/bin/clang -- works
-- Detecting C compiler ABI info
--- lib/system.c 2012-02-23 11:30:11.000000000 -0200
+++ lib/system.c.patched 2012-02-22 22:47:51.000000000 -0200
@@ -1161,7 +1161,14 @@
int groups_max(void)
{
-#if defined(SYSCONF_SC_NGROUPS_MAX)
+#if defined(DARWINOS)
+ /* On OS X, sysconf(_SC_NGROUPS_MAX) returns 16
+ * due to OS X's group nesting and getgrouplist
@lasombra
lasombra / samba.3.6.1.osx-getgrouplist.patch
Created February 23, 2012 00:45 — forked from angerman/samba.3.6.1.osx-getgrouplist.patch
_SC_NGROUPS_MAX cannot be used with getgrouplist on OS X
--- system.c.orig 2012-02-22 22:46:14.000000000 -0200
+++ system.c 2012-02-22 22:47:51.000000000 -0200
@@ -1161,7 +1161,14 @@
int groups_max(void)
{
-#if defined(SYSCONF_SC_NGROUPS_MAX)
+#if defined(DARWINOS)
+ /* On OS X, sysconf(_SC_NGROUPS_MAX) returns 16
+ * due to OS X's group nesting and getgrouplist
@lasombra
lasombra / introrx.md
Last active August 29, 2015 14:25 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing

The introduction to Reactive Programming you've been missing

(by @andrestaltz)

So you're curious in learning this new thing called Reactive Programming, particularly its variant comprising of Rx, Bacon.js, RAC, and others.

Learning it is hard, even harder by the lack of good material. When I started, I tried looking for tutorials. I found only a handful of practical guides, but they just scratched the surface and never tackled the challenge of building the whole architecture around it. Library documentations often don't help when you're trying to understand some function. I mean, honestly, look at this:

Rx.Observable.prototype.flatMapLatest(selector, [thisArg])

Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.

{
"id":45,
"usuario":"Aluno Three",
"entregue":true,
"entregueEm":"2015-06-05T07:19:44Z",
"questoesRespondidas":[
{
"idQuestao":97,
"peso":1.0,
"questaoRespondida":"<p>&ldquo;Iniciar a frase com pronome &aacute;tono s&oacute; &eacute; l&iacute;cito na conversa&ccedil;&atilde;o familiar, despreocupada, ou na l&iacute;ngua escrita quando se deseja reproduzir a fala dos personagens (...)&rdquo;.&nbsp;Comparando a explica&ccedil;&atilde;o dada pelos autores sobre essa regra, pode-se afirmar que ambos:<\u002fp>\r\n<p>&nbsp;<\u002fp>",