Skip to content

Instantly share code, notes, and snippets.

View mariusbutuc's full-sized avatar
🌏

Marius Butuc mariusbutuc

🌏
  • Toronto, ON
  • 04:09 (UTC -04:00)
View GitHub Profile
@mariusbutuc
mariusbutuc / pg_install.bash
Last active August 29, 2015 14:04
pg gem installation requirements to work in conjunction w/ Postgres.app
# check here for context: http://stackoverflow.com/a/24897553/341929
env ARCHFLAGS="-arch x86_64" gem install pg -- \
--with-pg-config=/Applications/Postgres.app/Contents/Versions/9.3/bin/pg_config
require 'digest'
# Get SHA256 Hash of a file
puts Digest::SHA256.hexdigest File.read "data.dat"
# Get MD5 Hash of a file
puts Digest::MD5.hexdigest File.read "data.dat"
# Get MD5 Hash of a string
puts Digest::SHA256.hexdigest "Hello World"
# Get SHA256 Hash of a string using update
@mariusbutuc
mariusbutuc / com.googlecode.iterm2.plist
Created July 21, 2014 20:48
A Solarize colour scheme for iTerm2 where 'green' is actually green
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AdjustWindowForFontSizeChange</key>
<true/>
<key>AllowClipboardAccess</key>
<false/>
<key>AnimateDimming</key>
<false/>
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<faultcode>SOAP-ENV:Client</faultcode>
<faultstring>20113 - Campaign not found</faultstring>
<detail>
<ns1:serviceException xmlns:ns1="http://www.marketo.com/mktows/">
<name>mktServiceException</name>
<message>Request campaign needs to have a 'Campaign Requested' trigger and needs to be activeted, cannot request forMarketyProgram (20113)</message>
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="http://www.marketo.com/mktows/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.marketo.com/mktows/">
<SOAP-ENV:Header>
<ns1:AuthenticationHeader>
<mktowsUserId>...</mktowsUserId>
<requestSignature>...</requestSignature>
<requestTimestamp>2014-06-12T13:26:58-04:00</requestTimestamp>
</ns1:AuthenticationHeader>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
@mariusbutuc
mariusbutuc / pusher_connections.js
Last active August 29, 2015 14:01
Pusher Stats: focus on open connections data
/*
* Goal: see the peaks in Pusher connection counts
*
* Data: https://app.pusher.com/stats
* Example: http://i.imgur.com/ok517vf.png
*
*/
// Make graphs full-width
$('#sidebar-nav, .navbar, #IntercomDefaultWidget').css('display', 'none');
@mariusbutuc
mariusbutuc / private_pub.rb
Created April 28, 2013 16:36
Private_pub binding faye unsubscribe
# Run with: rackup private_pub.ru -s thin -E production
require "bundler/setup"
require "yaml"
require "faye"
require "private_pub"
require "active_support/core_ext"
Faye::WebSocket.load_adapter('thin')
PrivatePub.load_config(File.expand_path("../config/private_pub.yml", __FILE__), ENV["RAILS_ENV"] || "development")
@mariusbutuc
mariusbutuc / mysql_grant_user.output
Created March 10, 2013 22:42
The database password is now filtered by Chef both in the console and in the log on disk. – http://vialstudios.com/guide-authoring-cookbooks.html#creating_a_mysql_user_with_the_database_cookbook
[2013-03-10T22:37:35+00:00] INFO: mysql_database_user[scafandru_app]: granting access with statement [GRANT all ON `scafandru_dev`.* TO `scafandru_app`@`localhost` IDENTIFIED BY [FILTERED]]
@mariusbutuc
mariusbutuc / output.sh
Created March 10, 2013 02:38
Chef Solo + Berkshelf + Vagrant » Install nginx from source
$ vagrant up
[default] Importing base box 'precise64bootstrap'...
[default] Matching MAC address for NAT networking...
[default] Clearing any previously set forwarded ports...
[default] Fixed port collision for 22 => 2222. Now on port 2201.
[default] Forwarding ports...
[default] -- 22 => 2201 (adapter 1)
[Berkshelf] installing cookbooks...
[Berkshelf] Using nginx (1.4.0)
[Berkshelf] Using bluepill (2.2.0)

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt