Skip to content

Instantly share code, notes, and snippets.

View Tantas's full-sized avatar

Joseph Preiss Tantas

  • Toronto Area, Ontario, Canada
View GitHub Profile
@Tantas
Tantas / Offscreen CSS
Created May 7, 2014 17:30
Place off screen in an accessible manner. Useful for hidden labels.
.offscreen {
position: absolute;
left: -999em;
xwidth: 90em;
xoverflow: hidden;
}
@Tantas
Tantas / gist:5412d1e319c69d0d56ab
Last active August 29, 2015 14:04 — forked from cdown/gist:1163649
Pure Bash Implementation of URL Decode
stripEncodedLineEndings() {
# stripEncodedLineEndings <string>
local stripFirstPart="${1//%0D}"
echo "${stripFirstPart//%0A}"
}
urlencode() {
# urlencode <string>
@Tantas
Tantas / gist:0646fc06de60e3f80ec6
Last active August 29, 2015 14:04
Acanac ISP Health Check
#!/bin/bash
#===============================================================================
# from https://gist.github.com/Tantas/5412d1e319c69d0d56ab
stripEncodedLineEndings() {
# stripEncodedLineEndings <string>
local stripFirstPart="${1//%0D}"
echo "${stripFirstPart//%0A}"
}
@Tantas
Tantas / SKShapeNode+Area.h
Created July 31, 2014 01:43
SKShapeNode+Area
#import <SpriteKit/SpriteKit.h>
@interface SKShapeNode (Area)
-(float) area;
@end
#import <SpriteKit/SpriteKit.h>
#import <AGGeometryKit.h>
@interface SKShapeNode (Cuttable)
-(NSArray*)cutWithLine:(AGKLine)cutLine;
@end
@Tantas
Tantas / create_sftp_server_guide.sh
Created August 6, 2014 00:08
Create SFTP Server Guide
#!/bin/bash
# Create SFTP Server Steps
echo "This is a guide. Do not execute this as a script."
exit -1
# Create a restricted user with:
# -no shell access
# -no ssh access
# -no application access
@Tantas
Tantas / create_tomcat_run_user.sh
Created August 6, 2014 00:13
Creates a tomcat run user.
#!/bin/bash
# Create a tomcat run user and apply ownership.
# Example used for DotCMS.
echo "This is a guide. Do not execute this as a script."
exit -1
# Create a group with no permissions
sudo groupadd dotcmsusers
@Tantas
Tantas / create_rsa_key_and_install_guide.sh
Last active August 29, 2015 14:04
Guide to create and install an RSA key onto a remote machine.
#!/bin/bash
# Create an rsa key and install on a remote machine.
echo "This is a guide. Do not execute this as a script."
exit -1
# Create a new rsa key and deploy to a server. Make sure to add a password.
ssh-keygen -t rsa -C "username@host"
@Tantas
Tantas / create_self_signed_ssl_cert.sh
Created August 6, 2014 01:19
Create a self signed SSL cert and install
#!/bin/bash
# Create a self signed SSL cert and install
# Generate a private key
openssl genrsa -des3 -out server.key 1024
# Generate a CSR (Certificate Signing Request)
openssl req -new -key server.key -out server.csr
@Tantas
Tantas / lighttpd.conf
Created August 6, 2014 01:26
Start a lighttpd web server over a development directory.
server.document-root = "/development/directory/to/serve"
server.dir-listing = "enable"
server.port = 80
mimetype.assign = (
".png" => "image/png",
".jpg" => "image/jpeg",
".xml" => "text/xml",
".html" => "text/html",