Skip to content

Instantly share code, notes, and snippets.

View akatakritos's full-sized avatar

Matt Burke akatakritos

View GitHub Profile
@akatakritos
akatakritos / root-based-category-urls.php
Last active December 16, 2015 10:29 — forked from mikeschinkel/root-based-category-urls.php
Added PREG_DELIM to stop warning about unknown modifier
<?php
/*
* Plugin Name: Root-based Category URLs
* Description: Enables root-based Category URLs, i.e. Makes /category/my-category/ URLs route as /my-category/
* Author: Mike Schinkel
* Author URI: http://about.me/mikeschinkel
* Plugin URI: https://gist.github.com/1421235
* Version: 0.1.1
* License: GPL 2+
*/
@akatakritos
akatakritos / ssh-same-directory
Created April 22, 2013 15:45
ssh to same directory on a known server. useful when you have the same directory structure on your local machine as the server. put in your profile scripts.
function devserver {
echo "ssh devserver -t 'cd $PWD; bash --login'"
ssh devserver -t "cd $PWD; bash --login"
}
@akatakritos
akatakritos / trackevent_patch.js
Created June 3, 2013 13:36
trackEvent patch example. Example of patching Google anayltics push function. As an example, overrides the _trackEvent method to pop an alert with the event details. Finally, call the real analytics function so as to not break the tracking.
<script type="text/javascript">
(function(){
var realPushFunction = window._gaq.push;
window._gaq.push = function(params) {
if (params[0] == "_trackEvent") {
alert("category: " + params[1] +
"\naction: " + params[2] +
"\nopt_label: " + params[3] +
"\nopt_value: " + params[4]);
}
@akatakritos
akatakritos / SampleGruntfile.js
Last active August 29, 2015 14:03
My default Gruntfile.js. Because I keep cobbling this together from various projects.
module.exports = function(grunt) {
'use strict';
grunt.initConfig({
concat: {
options: {
banner: "/*\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT DIRECTLY, INSTEAD BUILD WITH grunt. \n * \n */\n",
nonull: true
},
master: {
src: [
@akatakritos
akatakritos / GeneratedSql.sql
Last active August 29, 2015 14:03
EF6 Generated SQL
SELECT TOP (4)
[Project1].[ProductID] AS [ProductID],
[Project1].[Name] AS [Name],
[Project1].[Description] AS [Description],
[Project1].[Price] AS [Price],
[Project1].[Category] AS [Category]
FROM ( SELECT [Project1].[ProductID] AS [ProductID], [Project1].[Name] AS [Name], [Project1].[Description] AS [Description], [Project1].[Price] AS [Price], [Project1].[Category] AS [Category], row_number() OVER (ORDER BY [Project1].[ProductID] ASC) AS [row_number]
FROM ( SELECT
[Extent1].[ProductID] AS [ProductID],
[Extent1].[Name] AS [Name],
@akatakritos
akatakritos / keybase.md
Created February 26, 2015 16:39
keybase.md

Keybase proof

I hereby claim:

  • I am akatakritos on github.
  • I am akatakritos (https://keybase.io/akatakritos) on keybase.
  • I have a public key whose fingerprint is 7776 FE10 C19C 552B A5D1 F36A 3F95 F777 B69E 743A

To claim this, I am signing this object:

@akatakritos
akatakritos / Age.cs
Created May 1, 2015 12:46
LEAKED: Microsofts How Old age detection code
// (c) 2015 Microsoft Inc.
// All rights reserved
namespace HowOld.Common
{
public static class Age
{
public static int Calculate(byte[] imageData)
{
return new Random().Next(2, 65);
@akatakritos
akatakritos / Rollbar.targets
Last active August 29, 2015 14:20 — forked from matt-hensley/Rollbar.targets
Rollbar.targets for Azure - pull Rollbar settings from Azure environment variables
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target Name="NotifyRollbarOfDeploy" AfterTargets="MSDeployPublish;CopyAllFilesToSingleFolderForPackage">
<Exec Command="git log -1 --format=%%H" ConsoleToMSBuild="true" EchoOff="true">
<Output TaskParameter="ConsoleOutput" PropertyName="GitSHA" />
</Exec>
<Exec Command="git config user.email" ConsoleToMSBuild="true" EchoOff="true" WorkingDirectory="$(ProjectDir)\..">
<Output TaskParameter="ConsoleOutput" PropertyName="GitEmail" />
</Exec>
@akatakritos
akatakritos / msbuild.rake
Last active August 29, 2015 14:28 — forked from anonymous/msbuild.rake
Example Rake tasks for @avdi (.NET Web Development with Cygwin)
sln = Dir.glob("*.sln").first
msbuild = "/cygdrive/c/Program Files (x86)/MSBuild/14.0/Bin/MSBuild.exe"
desc "msbuild the solution"
task :build do
sh msbuild, sln
end
desc "runs nunit on valid UnitTests.*.dll assemblies"
task :test => [:build] do
@akatakritos
akatakritos / Example1.cs
Created December 7, 2015 21:12
Kentico REST API Examples
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using Newtonsoft.Json.Linq;
namespace KenticoRestSample