Skip to content

Instantly share code, notes, and snippets.

@halidaltuner
halidaltuner / gist:661404
Created November 3, 2010 17:35
uploadify image random name generating
<?php
if (!empty($_FILES)) {
$tempFile = $_FILES['Filedata']['tmp_name'];
$targetPath = $_SERVER['DOCUMENT_ROOT'] . $_GET['folder'] . '/images/products/';
$ext = pathinfo($_FILES['Filedata']['name'], PATHINFO_EXTENSION);
$newFileName = md5($tempFile.microtime()).'.'.$ext;
$targetFile = str_replace('//','/',$targetPath) . $newFileName;
move_uploaded_file($tempFile,$targetFile);
}
echo $newFileName;
@maji-KY
maji-KY / glassfish
Created December 5, 2012 13:48
GlassFish Init Script
#!/bin/sh
#
# glassfish Startup script for glassfish
#
# chkconfig: - 99 01
# processname: glassfish
# config: /etc/glassfish/glassfish.conf
# config: /etc/sysconfig/glassfish
# pidfile: /var/run/glassfish.pid
# description: glassfish is a JavaEE Application Server
@technopagan
technopagan / default
Created December 7, 2012 08:23
High Performance Wordpress Webserver Stack with NGINX, PHP-FPM + APC and Varnish
# We only have one backend to define: NGINX
backend default {
.host = "127.0.0.1";
.port = "8080";
}
# Only allow purging from specific IPs
acl purge {
"localhost";
"127.0.0.1";
@kimmobrunfeldt
kimmobrunfeldt / 0-osx-for-web-development.md
Last active July 26, 2022 13:30
Install web development tools to Mavericks (OS X 10.9)

Install web development tools to Mavericks (OS X 10.9)

Strongly opinionated set of guides to quickly setup OS X Mavericks for web development. By default OS X hides stuff that normal people don't need to see. These settings are better defaults for developers.

I don't want: any sounds, annoying confirmation dialogs, hidden extensions, superflous animations, unnecessary things running like Dashboard, Notification center or Dock(Alfred/spotlight works better for me).

These are my opinions. Read this document through and pick up the good parts to your preferences.

System preferences

@kevinelliott
kevinelliott / osx-10.10-setup.md
Last active December 1, 2023 08:21
Mac OS X 10.10 Yosemite Setup

Mac OS X 10.10 Yosemite

Custom recipe to get OS X 10.10 Yosemite running from scratch, setup applications and developer environment. I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install. On average, I reinstall each computer from scratch every 6 months, and I do not perform upgrades between distros.

This keeps the system performing at top speeds, clean of trojans, spyware, and ensures that I maintain good organizational practices for my content and backups. I highly recommend this.

You are encouraged to fork this and modify it to your heart's content to match your own needs.

Install Software

@ugurerkan
ugurerkan / zimbra-letsencrypt-renew.md
Last active September 9, 2023 13:19
Zimbra 8.6.0 Letsencrypt SSL renew walkthrough.