Quantcast
Channel: Mark – Program & Design
Browsing all 12 articles
Browse latest View live

High quality image resize (C#)

You can use this class to resize images proportionally (maintaining aspect ratio), or to resize an image to an exact size and crop off excess (useful for making nice thumbnails): public static class...

View Article



PHP: Generate a unique filename for a given directory

This function will generate a filename unique to specified directory. If you’re using it to create filenames for uploaded images, for example, you can give it a path to your upload folder an extension...

View Article

WAMP: Apache won’t start/icon stays green

I have a non-standard installation of WAMP. I’ve installed it to my Z:/wamp . Recently it stopped working. All the suggestions I found on the web told me to check port 80, or check the apache_error.log...

View Article

Find devices on your network

I have a NAS device on my network which has a web interface, but I didn’t know it’s IP. Running this simple command from cmd.exe gave me a handful of IPs to try which lead me to finding it very...

View Article

Meteor, Blade + Windows 8

Introductions Meteor is a hot new Node-based web development framework. Blade is a templating language based on Jade, which is a bit similar to Haml. Windows 8 is an operating system that no one but me...

View Article


Compile all Jade files to a single client-side JavaScript file

Jade is “a high performance template engine heavily influenced by Haml and implemented with JavaScript for node”. One of it’s nice features is that it lets you compile your Jade templates into...

View Article

Two-way implicit casting

I’m presently writing a framework that wraps a C API using interop. Many of the classes/structs defined in the C library already exist in .NET, but I have to re-implement them anyway so that I can...

View Article

Selenium, PhantomJS, Node, Screenshots and Sizzle

Without going into too much detail, I just wanted to post a snippet of how to get all these technologies playing nicely together: var webdriver = require('selenium-webdriver'); var fs = require('fs');...

View Article


Installing node-canvas on Windows

There’s an article here that describes the process, but it’s a bit vague in some areas and didn’t work for me. If you’re on 64-bit Windows, you will need the 64-bit version of GTK which comes bundled...

View Article


How to generate a deployment key for Bitbucket

SSH into your server Run “ssh-keygen -t rsa” to generate a public and private key pair It will ask you where you to save the files.  I recommend “/root/.ssh/bitbucket” It will ask you to choose a...

View Article

How to optimize a website in 2018

Let’s start with caching. So many levels of caching. Before we even get to your website, there’s the DNS. What IP does your domain point to? Usually your OS will cache this DNS lookup for you, failing...

View Article

How to post a message to your Slack channel with cURL (from bash)

I’ll get straight to it. Here’s the code: We’re using jq to properly format a JSON message here. Without it, there’s a high probability that the $changelog would break due to having line breaks and...

View Article
Browsing all 12 articles
Browse latest View live


Latest Images