Skip to content

Instantly share code, notes, and snippets.

Robert Sim robertsky

Block or report user

Report or block robertsky

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@robertsky
robertsky / timestamp.vb
Created Dec 11, 2018
Timestamp UDF Excel
View timestamp.vb
Function Timestamp(Reference As Range)
If IsNumeric(Application.Caller.Text) = False Or Application.Caller.Text = "0" Then
If InStr(Reference.Value2, "generated correctly") > 0 Then
'Debug.Print (Application.Caller.Address & " test2")
Timestamp = CStr(DateDiff("s", "01/01/1970 00:00:00", Now()) * 1000 + Int(1000 * Rnd))
Else
'Debug.Print (Application.Caller.Address & " test1")
Timestamp = ""
View SubstituteSpecialCharacters
=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE("<><><text to convert here><><>", " ", "%20"), "!", "%21"), "CHAR(34)", "%22"), "#", "%23"), "$", "%24"), "%", "%25"), "&", "%26"), "'", "%27"), "(", "%28"), ")", "%29"), "*", "%2A"), "+", "%2B"), ",", "%2C"), "-", "%2D"), ".", "%2E"), "/", "%2F"), ":", "%3A"), ";", "%3B"), ">", "%3E"), "?", "%3F"), "@", "%40"), "[", "%5B"), "\", "%5C"), "]", "%5D"), "^", "%5E"), "_", "%5F"), "`", "%60"), "{", "%7B"), "}", "%7D"), "<", "%3C"), "=", "%3D"), "~", "%7E")
@robertsky
robertsky / conf.d-site
Last active Jul 4, 2016
nginx wordpress
View conf.d-site
# Redirect everything to the main site. We use a separate server statement and NOT an if statement - see http://wiki.nginx.org/IfIsEvil
server {
server_name _;
rewrite ^ $scheme://example.com$request_uri redirect;
}
server {
listen 80;
server_name example.com www.example.com;
@robertsky
robertsky / 30daysGoogleAnalytics.r
Created Dec 26, 2015
30 days look back from Google Analytics.
View 30daysGoogleAnalytics.r
setwd("~/Documents/R/")
require(dplyr)
require(RGoogleAnalytics)
# Authorize the Google Analytics account
# This need not be executed in every session once the token object is created
# and saved
token <- Auth(client.id,client.secret)
# Save the token object for future sessions
@robertsky
robertsky / deploy.sh
Created Oct 13, 2015
Deploy WordPress plugin from git to wordpress.org repo. Adapted from https://github.com/pdclark/deploy-plugin-to-wordpress-dot-org
View deploy.sh
#! /bin/bash
# Source: https://raw.github.com/thenbrent/multisite-user-management/master/deploy.sh
# http://thereforei.am/2011/04/21/git-to-svn-automated-wordpress-plugin-deployment/
# A modification of Dean Clatworthy's deploy script as found here: https://github.com/deanc/wordpress-plugin-git-svn
# The difference is that this script lives in the plugin's git repo & doesn't require an existing SVN repo.
# main config
PLUGINSLUG=${PWD##*/} # returns basename of current directory
CURRENTDIR=`pwd`
MAINFILE="display-ssh.php" # this should be the name of your main php file in the wordpress plugin
@robertsky
robertsky / quick_directory_listing.rb
Created May 18, 2014
A quick cobbling of Ruby codes to do a directory listing of hard disk(s).
View quick_directory_listing.rb
#name: quick_directory_listing.rb
#author: robertsky
#url: http://robertsky.com
#github: https://github.com/robertsky
#gem install sys-filesystem
#https://github.com/djberg96/sys-filesystem
require 'sys/filesystem'
curDir = Dir.pwd
You can’t perform that action at this time.