Skip to content

Instantly share code, notes, and snippets.

@evanphx
evanphx / component.js
Last active February 10, 2016 00:09
Ember observer
import Ember from 'ember';
export default Ember.Component.extend({
organizations: Ember.inject.service("organizations"),
activeOrgChange: Ember.observer("organizations.active", function() {
var name = this.get("organizations.active.name");
useName(name);
}
})
@evanphx
evanphx / page.html
Created February 6, 2016 04:20
Weird TWC page
veritas :: vk-git/valar-client> curl -L http://www.google.com
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html>
<head>
<title>Road Runner</title>
<meta http-equiv="Content-Language" content="en-us" />
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252" />
<meta content="MSHTML 6.00.2800.1400" name="GENERATOR" />
@evanphx
evanphx / gist:8660589
Created January 28, 2014 01:03
RG 2.2.1 blowing up with perm issues
jenkins@jenkins1:~/jobs/migrator$ bundle install
Unfortunately, a fatal error has occurred. Please see the Bundler troubleshooting documentation at
http://bit.ly/bundler-issues. Thanks!
/usr/local/lib/ruby/2.0.0/fileutils.rb:245:in `mkdir': Permission denied - /usr/local/lib/ruby/gems/2.0.0/extensions/x86_64-linux (Errno::EACCES)
from /usr/local/lib/ruby/2.0.0/fileutils.rb:245:in `fu_mkdir'
from /usr/local/lib/ruby/2.0.0/fileutils.rb:219:in `block (2 levels) in mkdir_p'
from /usr/local/lib/ruby/2.0.0/fileutils.rb:217:in `reverse_each'
from /usr/local/lib/ruby/2.0.0/fileutils.rb:217:in `block in mkdir_p'
from /usr/local/lib/ruby/2.0.0/fileutils.rb:203:in `each'
from /usr/local/lib/ruby/2.0.0/fileutils.rb:203:in `mkdir_p'
@evanphx
evanphx / gist:8497063
Created January 18, 2014 21:47
Sample output from gist.github.com pegging Webkit
This file has been truncated, but you can view the full file.
Sampling process 2789 for 3 seconds with 1 millisecond of run time between samples
Sampling completed, processing symbols...
Analysis of sampling com.apple.WebKit.WebContent (pid 2789) every 1 millisecond
Process: com.apple.WebKit.WebContent [2789]
Path: /System/Library/PrivateFrameworks/WebKit2.framework/Versions/A/XPCServices/com.apple.WebKit.WebContent.xpc/Contents/MacOS/com.apple.WebKit.WebContent
Load Address: 0x1074a6000
Identifier: com.apple.WebKit.WebContent
Version: 9537 (9537.73.11)
Build Info: WebKit2-7537073011000000~21
Code Type: X86-64
@evanphx
evanphx / gist:8466425
Created January 17, 2014 00:46
Packer bailing out
aero :: vk-git/packer-cgroups> packer build -only=virtualbox-ovf updated.json
virtualbox-ovf output will be in this color.
7 error(s) occurred:
* Unknown configuration key: boot_command
* Unknown configuration key: guest_additions_path
* Unknown configuration key: http_directory
* Unknown configuration key: iso_checksum
* Unknown configuration key: iso_checksum_type
func times(n int, lamb func(i int)) {
for i := 0; i < n; i++ {
lamb(i)
}
}
times(i -> { fmt.Printf("=> %d", i) })
@evanphx
evanphx / test.json
Created December 24, 2013 00:03
Test pubuser http protocol
{
"username": "evanphx",
"name": "Evan Phoenix",
"ssh_keys": [
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDNKQcKibi+gHYqphMje9lOzwDbM9q4NHPbeuD0022X7g22QNuQDHwsAlJ/JpGKU240302sahy7cMfBNU5+Rp2kzCI/XE9NdCIC94TlDtV+l9E7n8uI68/Of1i3xupmLdv8NB6Y8F/RQ2qOfZxsbdHHdLsSTxBOc7jWV98eaPyLLuV7N+q76ADW9d+0e9PmGwOfkchMXFq7N5IlSmzL3NCkcd6LzCCV0c1eh3/MbdzY/4vavmrDfRct8EI6Jy14lDexymQ8eG/w2zrkv0Zt8ZMkCdJPk+pmm7PQ5TlJs1GTVLAMVrGjtuvLRs1CNkRGEJ3ye/1IE53URaYaCGVjpn/v evan@aero.local"
],
"groups": ["test"]
}
@evanphx
evanphx / gist:7779979
Created December 4, 2013 00:00
new --trace option to Rubygems
aero :: rubygems/tmp> time ruby -I../lib -S gem install -g --explain --trace
T| 002 => [:fetch, #<URI::HTTPS:0x007fb14c1a0130 URL:https://api.rubygems.org/api/v1/dependencies>]
T| 002 <= 0.80s
T| 003 => [:resolve]
T| 004 => [:versions, "rails"]
T| 005 => [:fetch, #<URI::HTTPS:0x007fb14c189138 URL:https://api.rubygems.org/api/v1/dependencies?gems=rails>]
T| 005 <= 0.96s
T| 004 <= 0.97s
T| 006 => [:prefetch, ["actionmailer", "actionpack", "activerecord", "activeresource", "activesupport", "bundler", "less-rails", "rails_admin", "railties", "strong_parameters"]]
T| 007 => [:fetch, #<URI::HTTPS:0x007fb14d0f8010 URL:https://api.rubygems.org/api/v1/dependencies?gems=actionmailer,actionpack,activerecord,activeresource,activesupport,bundler,less-rails,rails_admin,railties,strong_parameters>]
(gdb) info threads
2 Thread 0x7f1ba4c27700 (LWP 12465) 0x00007f1ba3809a33 in poll () from /lib/libc.so.6
* 1 Thread 0x7f1ba4c17700 (LWP 12463) 0x00007f1ba438685c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
(gdb) bt
#0 0x00007f1ba438685c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#1 0x00007f1ba4743519 in native_cond_wait (cond=0x1d7c3e4, mutex=0x80) at thread_pthread.c:341
#2 0x00007f1ba474771b in native_sleep (th=<value optimized out>, timeout_tv=<value optimized out>) at thread_pthread.c:1015
#3 0x00007f1ba474a794 in rb_thread_terminate_all () at thread.c:429
#4 0x00007f1ba4608f5a in ruby_cleanup (ex=0) at eval.c:186
#5 0x00007f1ba4609015 in ruby_run_node (n=0x2497198) at eval.c:307
@evanphx
evanphx / gist:7400266
Created November 10, 2013 16:26
Weird dream
Vampire version of Deus-Ex Human Revolution
In a house with tech-vampires.
Some had vampire teeth.
I was a new recruit (I think).
Their vampireism was a result of some kind of techno-organic hybridization
A lot of computer UIs, most with a sort of LCars - Flat UI with a lot of horizontal elements