This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# lib/app_logger.rb | |
# vim: set ts=2 sw=2 expandtab: | |
class AppLogger < Logger | |
def format_message(severity, timestamp, progname, msg) | |
"#{timestamp.to_formatted_s(:db)} #{severity} #{msg}\n" | |
end | |
end | |
LOGGER = AppLogger.new('log/application.log', 'weekly') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option Explicit | |
Public Sub SaveMessageAsMsg() | |
Dim oMail As Outlook.MailItem | |
Dim objItem As Object | |
Dim sPath As String | |
Dim dtDate As Date | |
Dim sName As String | |
Dim sSender As String | |
Dim enviro As String |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Public Sub ResendToMe() | |
Dim oMail As Outlook.MailItem | |
Dim objItem As Object | |
Dim addr As String | |
addr = Application.GetNamespace("MAPI").Accounts.Item(1).SmtpAddress | |
For Each objItem In ActiveExplorer.Selection | |
Set oMail = objItem.Forward | |
oMail.Subject = "Delayed - " + oMail.Subject |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
umask 002 | |
repo=$1 | |
repo_base=/var/git | |
[ "$repo" = "" ] && { echo "usage: $0 new_repo_name"; exit; } | |
git --bare init $repo_base/$repo.git && \ | |
cd $repo_base/$repo.git && \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
... | |
# git via nginx ------------------------------------------------------ | |
location ~ /git(/.*) { | |
auth_basic ""; | |
auth_basic_user_file /var/git/.htpasswd; | |
fastcgi_pass unix:/var/run/fcgiwrap.socket; | |
fastcgi_param SCRIPT_FILENAME /usr/lib/git-core/git-http-backend; | |
fastcgi_param GIT_HTTP_EXPORT_ALL ""; | |
fastcgi_param GIT_PROJECT_ROOT /var/git; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### | |
# Namespace | |
### | |
Semantic = window.Semantic = Ember.Namespace.create | |
UI_DEBUG: false | |
UI_PERFORMANCE: false | |
UI_VERBOSE: false | |
### | |
# Mixin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'softlayer_api' | |
USER = "@@USERNAME@@" | |
API_KEY = "@@API_KEY@@" | |
client = SoftLayer::Client.new(username: USER, api_key: API_KEY) | |
puts client.to_json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
App.AuthenticatedRESTAdapter = DS.RESTAdapter.extend({ | |
ajax: function(url, type, hash) { | |
hash = hash || {}; | |
hash.headers = hash.headers || {}; | |
hash.headers['X-AUTHENTICATION-TOKEN'] = this.authToken; | |
return this._super(url, type, hash); | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def resize_nocrop_noscale(image, w,h) | |
w_original = image[:width].to_f | |
h_original = image[:height].to_f | |
if w_original < w && h_original < h | |
return image | |
end | |
# resize | |
image.resize("#{w}x#{h}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"apiVersion": "1.0.0", | |
"swaggerVersion": "1.2", | |
"basePath": "http://petstore.swagger.wordnik.com/api", | |
"resourcePath": "/store", | |
"produces": [ | |
"application/json" | |
], | |
"authorizations": {}, | |
"apis": [ |
OlderNewer