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
-- A quick rewrite of the Windower addon for Ashita v3 that swaps your macro pallette on job change. | |
-- Yes, I'm lazy. | |
_addon.name = 'MacroChanger' | |
_addon.author = 'Derahine' | |
_addon.version = '1.0.0.0' | |
require 'common' | |
jobs = { |
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
// grab article.comments, group by date (roll times up to full days), count up instances to get full counts per day. | |
// gotta be a better way... | |
db.Article.aggregate( | |
{$unwind: '$Comments'}, | |
{$group: { _id: '$Comments.DateCreated', count : {$sum: 1 }}}, | |
{$match: { '_id' : { $gte: ISODate('2014-02-21 00:00:00'), $lte: ISODate('2014-02-28 23:59:59') } }}, | |
{$project: { _id: 0, count: 1, 'date': '$_id', h: { $hour: '$_id' }, m: { $minute: '$_id'}, s: { $second: '$_id' }, ml: {$millisecond: '$_id'} } }, | |
{$project: { count: 1, 'dt': { "$subtract" : [ "$date", { "$add" : [ "$ml", { "$multiply" : [ "$s", 1000 ] }, { "$multiply" : [ "$m", 60, 1000 ] }, { "$multiply" : [ "$h", 60, 60, 1000 ] } ] } ] } }}, | |
{$group: { _id: '$dt', count: { $sum: '$count' } } }, |
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
# for when you're just too lazy to type out the merge command | |
# and change branches | |
function merge([string] $target, [string] $source) { | |
if ($source -eq "") { | |
$symbolicref = git symbolic-ref HEAD | |
$source = $symbolicref.substring($symbolicref.LastIndexOf("/") +1) | |
} | |
write-host "Merging $source into $target" -for white -ba red | |
git checkout $target; git merge $source; git checkout $source |
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
#IfWinActive, RIFT | |
!Tab:: | |
send {tab} | |
return | |
#Tab:: | |
send {tab} | |
return | |
#IfWinActive |
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
<?xml version="1.0" encoding="utf-8" ?> | |
<settings> | |
<common> | |
<release>.\release</release> | |
<web.config> | |
<appsettings> | |
</appsettings> | |
</web.config> | |
</common> |
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
param ( | |
[string]$Deploy, | |
[switch]$SkipBackup, | |
[string]$Settings = "settings.xml" | |
) | |
$success = $false | |
function writeError($message) { | |
Write-Host $message -Foreground Red | |
break; |
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
param ( | |
[string]$RoomNumber = (Read-Host "The room to post to (default: 123456) "), | |
[string]$Message = (Read-Host "The message to send ") | |
) | |
$defaultRoom = "123456" | |
if ($RoomNumber -eq "") { | |
$RoomNumber = $defaultRoom | |
} | |
$authToken = "YOUR AUTH TOKEN" |
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
[Serializable] | |
public class OracleSQLAliasToBeanTransformer : IResultTransformer | |
{ | |
const BindingFlags Flags = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance; | |
readonly System.Type _resultClass; | |
ISetter[] _setters; | |
readonly IPropertyAccessor _propertyAccessor; | |
readonly ConstructorInfo _constructor; | |
readonly PropertyInfo[] _fields; | |
public OracleSQLAliasToBeanTransformer(Type resultClass) |
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
$homeNet = "10.1.4.*", "OfficePrinter" | |
$remoteNet = "10.1.6.*", "W382_HP_Printer" | |
function Set-DefaultPrinter([string]$printerPath) { | |
$printers = gwmi -class Win32_Printer -computer . | |
Write-Host -fore cyan "Default Printer: $printerPath" | |
$dp = $printers | ? { $_.deviceID -match $printerPath } | |
$dp.SetDefaultPrinter() | Out-Null | |
} |
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
gnome-desktop-item-edit ~/Desktop/ --create-new | |
#just so I don't forget... again. |
NewerOlder