Skip to content

Instantly share code, notes, and snippets.

View smashwilson's full-sized avatar
🤖
HAPPINESS IS MANDATORY

Ash Wilson smashwilson

🤖
HAPPINESS IS MANDATORY
  • GitHub Staff
  • 09:54 (UTC -04:00)
View GitHub Profile
@smashwilson
smashwilson / core-failures
Created August 17, 2014 23:22
Atom script/grunt test output on Linux Mint
>> [2038:0817/132045:ERROR:browser_main_loop.cc(163)] Running without the SUID sandbox! See https://code.google.com/p/chromium/wiki/LinuxSUIDSandboxDevelopment for more information on developing with the sandbox on.
>> ATTENTION: default value of option force_s3tc_enable overridden by environment.
>> [2069:0817/132046:INFO:renderer_main.cc(227)] Renderer process started
>> [2038:0817/132047:INFO:CONSOLE(92)] "Download the React DevTools for a better development experience: http://fb.me/react-devtools", source: /home/smash/code/atom/node_modules/react-atom-fork/lib/React.js (92)
>> ..[2038:0817/132048:INFO:CONSOLE(122)] "Failed to load package named 'package-with-broken-keymap'", source: /home/smash/code/atom/src/package.coffee (122)
>> .................................[2038:0817/132050:INFO:CONSOLE(301)] "Error compiling less stylesheet: /home/smash/.atom/packages/script/stylesheets/script.less
>> Line number: 8
>> 'ui-mixins.less' wasn't found", source: /home/smash/code/atom/src/theme-manager.coffee (301)
>>
@smashwilson
smashwilson / ocr.rb
Created April 12, 2014 14:26
Read images from a webcam. OCR any text and write it to stdout.
require 'hornetseye_v4l2'
require 'hornetseye_xorg'
require 'hornetseye_rmagick'
require 'tesseract'
include Hornetseye
camera = V4L2Input.new
image = X11Display.show { camera.read }
image.to_ubytergb.save_ubytergb 'snapshot.png'
Date/Time: 2014-04-11 14:05:25 -0400
OS Version: 10.9.2 (Build 13C64)
Architecture: x86_64
Report Version: 18
Command: Atom
Path: /Applications/Atom.app/Contents/MacOS/Atom
Version: 0.84.0 (0.84.0)
Parent: launchd [266]
@smashwilson
smashwilson / bench.rb
Last active August 29, 2015 13:58
excon case-insensitive header access benchmarks
#!/bin/env ruby
#
# Benchmark any performance degredation associated with moving to case-
# insensitive HTTP header access.
require 'benchmark'
require './lib/excon'
resp = Excon::Response.new
resp.headers = {}
[x, ourRef, ourText, theirText, theirRef] = m.match
console.log "Match range: #{m.range}"
[baseRow, baseCol] = m.range.start.toArray()
console.log "baseRow = #{baseRow}, baseCol = #{baseCol}"
ourLines = ourText.split /\n/
ourRowStart = baseRow + 1
ourRowEnd = ourRowStart + ourLines.length - 1
console.log "baseRow = #{baseRow}, ourRowStart = #{ourRowStart}"
@smashwilson
smashwilson / vagrant-rackspace-output
Created March 18, 2014 15:40
vagrant-rackspace-plugin output.
Bringing machine 'default' up with 'rackspace' provider...
==> default: Finding flavor for server...
==> default: Finding image for server...
==> default: Launching a server with the following settings...
==> default: -- Flavor: 512MB Standard Instance
==> default: -- Image: CentOS 6.5 (PVHVM)
==> default: -- Name: ash-vagrant-rackspace
==> default: Waiting for the server to be built...
==> default: Waiting for SSH to become available...
==> default: The server is ready!
@smashwilson
smashwilson / socket-io-ssl.apacheconf
Last active August 29, 2015 13:57
An Apache configuration that works with socket.io 0.9.x.
<IfModule mod_ssl.c>
<VirtualHost _default_:443>
ServerAdmin webmaster@localhost
DocumentRoot /var/www
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.

Keybase proof

I hereby claim:

  • I am smashwilson on github.
  • I am smashwilson (https://keybase.io/smashwilson) on keybase.
  • I have a public key whose fingerprint is E4AE B392 BCBF 7F83 41A6 53A9 61F7 489B 6751 9BF6

To claim this, I am signing this object:

@smashwilson
smashwilson / fog-copy.rb
Created January 29, 2014 16:37
Perform a server-side copy of a file in Cloud Files.
require 'fog'
# To connect to ServiceNet, this needs to run from a Cloud Server in the same datacenter as your
# Cloud Files containers.
service = Fog::Storage.new(
provider: 'rackspace',
rackspace_username: ENV['RAX_USERNAME'],
rackspace_api_key: ENV['RAX_API_KEY'],
rackspace_region: :ord,
rackspace_servicenet: true
require 'fog'
require 'base64'
service = Fog::Compute.new(
provider: 'rackspace',
rackspace_username: ENV['RAX_USERNAME'],
rackspace_api_key: ENV['RAX_API_KEY'],
rackspace_region: :ord
)