Skip to content

Instantly share code, notes, and snippets.

View ericdagenais's full-sized avatar

Eric Dagenais ericdagenais

View GitHub Profile
@ericdagenais
ericdagenais / pgadmin2datagrip.rb
Last active January 26, 2022 21:00
Windows: Import PgAdmin 3 Connections to Navicat and DataGrip
require 'win32/registry'
passwords = Hash.new
file = nil
begin
file = File.new("#{ENV['APPDATA']}\\postgresql\\pgpass.conf", "r")
while (line = file.gets)
c = line.split(':')
key = "#{c[0]}:#{c[1]}:#{c[2]}:#{c[3]}"
passwords[key] = c[4].strip if c.length > 4
Index: libavformat/mov.c
===================================================================
--- libavformat/mov.c (revision 17434)
+++ libavformat/mov.c (working copy)
@@ -104,6 +104,11 @@
unsigned flags;
} MOVTrackExt;
+typedef struct {
+ unsigned int track_duration;
@interface NSManagedObject (Serialization)
- (NSDictionary*) toDictionary;
- (void) populateFromDictionary:(NSDictionary*)dict;
+ (NSManagedObject*) createManagedObjectFromDictionary:(NSDictionary*)dict
inContext:(NSManagedObjectContext*)context;
@end
// Photoshop Script to Create iPhone Icons from iTunesArtwork
//
// WARNING!!! In the rare case that there are name collisions, this script will
// overwrite (delete perminently) files in the same folder in which the selected
// iTunesArtwork file is located. Therefore, to be safe, before running the
// script, it's best to make sure the selected iTuensArtwork file is the only
// file in its containing folder.
//
// Copyright (c) 2010 Matt Di Pasquale
// Added tweaks Copyright (c) 2012 by Josh Jones http://www.appsbynight.com
username: vagrant
password: vagrant
sudo apt-get update
sudo apt-get install build-essential zlib1g-dev git-core sqlite3 libsqlite3-dev
sudo aptitude install mysql-server mysql-client
sudo nano /etc/mysql/my.cnf
@ericdagenais
ericdagenais / App.config
Created February 10, 2013 14:18
Sample GelfUdpAppender and RemoteSyslogAppender configuration
<appender name="GelfUdpAppender" type="Gelf4net.Appender.GelfUdpAppender, Gelf4net">
<remoteAddress value="graylog2.address"/>
<remotePort value="12201"/>
<layout type="Gelf4net.Layout.GelfLayout, Gelf4net">
<param name="AdditionalFields" value="app:AppName,version:trunk,Level:%level,Logger:%logger,Thread:%thread,Exception:%exception" />
<param name="Facility" value="AppName"/>
<param name="IncludeLocationInformation" value="true"/>
</layout>
</appender>
@ericdagenais
ericdagenais / heroku_unicorn_logger_fix.rb
Created November 17, 2012 12:36 — forked from jamiew/heroku_unicorn_logger_fix.rb
Fix Heroku cedar app logging with Rails 3.1 and Unicorn
# config/environments/production.rb
# We're on Heroku, just output straight to STDOUT
# This is required because we're using Unicorn: https://github.com/ryanb/cancan/issues/511#issuecomment-3643266
config.logger = Logger.new(STDOUT)
config.logger.level = Logger.const_get(ENV['LOG_LEVEL'] ? ENV['LOG_LEVEL'].upcase : 'INFO')
@ericdagenais
ericdagenais / rbenv-install-system-wide.sh
Created November 5, 2012 21:54 — forked from jnx/rbenv-install-system-wide.sh
rbenv install and system wide install on Ubuntu 10.04 LTS.
# Update, upgrade and install development tools:
apt-get update
apt-get -y upgrade
apt-get -y install build-essential
apt-get -y install git-core
# Install rbenv
git clone git://github.com/sstephenson/rbenv.git /usr/local/rbenv
# Add rbenv to the path:
@ericdagenais
ericdagenais / RecordingVideo.js
Created August 22, 2012 01:25 — forked from dawsontoth/RecordingVideo.js
How to record video, then share or save it. Using Appcelerator Titanium!
/**
* This sample lets you record and share video with Appcelerator Titanium on Android.
* REQUIRES THE 1.6.0 RC OF TITANIUM MOBILE SDK
* http://developer.appcelerator.com/blog/2011/02/release-candidate-for-titanium-mobile-1-6-0.html
*/
/**
* First, create our UI. We'll have two buttons: record, and share.
*/
var win = Titanium.UI.createWindow({
@ericdagenais
ericdagenais / TiUISmsDialogProxy.h
Created August 6, 2012 18:39 — forked from yellowandy/TiUISmsDialogProxy.h
SMS Dialogue support for TI
/**
* Appcelerator Titanium Mobile
* Copyright (c) 2009-2010 by Appcelerator, Inc. All Rights Reserved.
* Licensed under the terms of the Apache Public License
* Please see the LICENSE included with this distribution for details.
*/
#ifdef USE_TI_UISMSDIALOG
#import "TiProxy.h"
#import <MessageUI/MessageUI.h>