Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am robertpateii on github.
  • I am robertpateii (https://keybase.io/robertpateii) on keybase.
  • I have a public key ASD8JLeWAT3wdDBQREOVbO_YScnFe1Mpv5hEq1jwdI3jQwo

To claim this, I am signing this object:

@robertpateii
robertpateii / inaracz-portrait.css
Created February 1, 2019 04:29
Portrait-mode mobile styles for Inara.cz
@media screen and (max-width : 640px) {
div.menucontainer {
min-width: 0;
}
div.mainmenu {
height: 100%;
white-space: normal;
}
div.menu {
height: auto;
@robertpateii
robertpateii / SecureLinkProvider.cs
Last active August 29, 2015 13:58
Quick Link Provider I wrote to deliver HTTPS links. Sample code for my comment on [SSL Link Provider](http://marketplace.sitecore.net/en/Modules/SSL_Link_Provider.aspx) on the Sitecore Marketplace. Running Sitecore version 6.5.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Change.This.To.Suit.Your.Application
{
class SecureLinkProvider : Sitecore.Links.LinkProvider
{
@robertpateii
robertpateii / basic.svg
Created March 27, 2014 15:30
A simple SVG I wrote by hand to learn how it's done. If you want it to easily resize based on the width and height, the viewBox values need to match the total width and height of the shapes you've drawn. Then you can scale it up or down with the width and height attributes on the SVG element or with CSS.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@robertpateii
robertpateii / sample.cs
Last active January 1, 2016 18:19
When passing an object into a function, should the function bother returning a value or just update the object by reference?
// Populates with some data from the API.
ProductInfo productInfo = parseApiReply(apiResponse);
// Need to update some empty fields after doing some logic on the data from the API.
// I've been following the general guideline of always return a value so I write this:
productInfo = addUserInfo(productInfo, userID);
// But is it pointless to set visitorSerialInfo there since we can update it by reference in?
// I could just do this:
@robertpateii
robertpateii / .gitconfig
Created July 9, 2013 15:59
My Git config file.
[user]
name = Robert Pate
email = ---------------
[core]
editor=vim
[merge]
tool = winmerge
[mergetool "winmerge"]
cmd = \"C:/Program Files (x86)/winmerge/winmergeu.exe\" \"$MERGED\"
path = C:/Program Files (x86)/winmerge/winmergeu.exe
@robertpateii
robertpateii / fizzbuzz.js
Last active December 17, 2015 04:18 — forked from anonymous/fizzbuzz.js
Had to write my own version before before I ask other people to do the same. http://c2.com/cgi/wiki?FizzBuzzTest
var fizzBuzz = function fizzBuzz () {
"use strict";
var fizzArray = [];
var fizzNumCheck = function fizzNumCheck (num) {
var numString = "";
if (num % 3 === 0) {
numString += "Fizz";
}
@robertpateii
robertpateii / rob-vim-regexes.vim
Last active December 17, 2015 02:39
Handy vim regular expressions I've written to help with my job.
" Delete the first link on a line, leaving the link text untouched.
s/<a href=".\{-\}">\(.\{-\}\)<\/a>/\1/i
@robertpateii
robertpateii / smf-calendar.txt
Last active December 16, 2015 21:29
Calendar markup for your default Simple Machines Forum (SMF).
SMF Calendar: No plugins necessary. Just uses the table code. Easy to change and update.
Two ways to manage it:
1. If the poster wants tight control... make a post, edit as things change, and comment when it's up to date.
2. If multiple people need to manage... make a post, quote the previous post when it's time to add an event, add in the event, and post.
[b]Example:[/b]
@robertpateii
robertpateii / convertToSubTask.js
Created April 9, 2013 21:43
We use JIRA at work for bug tracking. There is no way currently to convert "Tasks" in bulk to "Sub-Tasks." I needed to convert about 30 tickets, so I wrote some JavaScript I could just copy/paste into the browser console on each page load. Saving it here in case this happens again.
function convertToSubTask (taskID) {
"use strict";
// Returns are required otherwise the rest of the if statements will attempt to execute.
// A switch statement would be easier to read and maintain.
// taskID must be a string.
if (jQuery("#issue-to-subtask").length > 0) {
window.open(jQuery("#issue-to-subtask").attr("href"), "_self");
return true;
}