Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/perl
use Mysql;
use strict;
use vars qw($school_name);
use vars qw($pass);
require "./cgi-lib.pl";
$ brew install -v /usr/local/Library/Taps/homebrew/homebrew-php/Formula/php54.rb
==> Downloading http://www.php.net/get/php-5.4.33.tar.bz2/from/this/mirror
Already downloaded: /Library/Caches/Homebrew/php54-5.4.33
==> Verifying php54-5.4.33 checksum
tar xf /Library/Caches/Homebrew/php54-5.4.33
Warning: Backing up all known pear.conf and .pearrc files
Warning: If you have a pre-existing pear install outside
of homebrew-php, or you are using a non-standard
pear.conf location, installation may fail.
==> ./configure --prefix=/usr/local/Cellar/php54/5.4.33 --localstatedir=/usr/local/var --sysconfdir=/usr/local/etc/php/5.4 --with-config-file-path=/usr/local/etc/php/5.4 --with-config-file-scan-dir=/usr/local/etc/php/5.4/conf.d --with-iconv-dir=/usr --enable-dba --with-ndbm=/usr --enable-exif --enable-intl --enable-soap --enable-wddx --enable-ftp --enable-sockets --enable-zip --enable-shmop --enable-sysvsem --enable-sysvshm --enable-sysvmsg --enable-mbstring --enable-mbregex --enable-bcmath --enable
$ brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry and just ignore them. Thanks!
Warning: Unbrewed dylibs were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
Unexpected dylibs:
@tunght13488
tunght13488 / Development checklist
Last active August 29, 2015 14:08
Development checklist
- [ ] Is error reporting on and display errors on in development and off in production?
- [ ] Do not suppress errors in your code.
- [ ] Implement a logging framework.
- [ ] Use a caching strategy.
- [ ] Keep in mind and use programming design patterns and best practices.
- [ ] Use tests in your code and try to automate running these tests every time a change occurs in the code base.
- [ ] Review or at least audit team members’ code.
- [ ] Practice defensive programming.
- [ ] Learn and use OOP principles correctly.
- [ ] Have a solid workflow and processes for developing and deploying code.
@tunght13488
tunght13488 / quadratic-bezier.js
Last active December 15, 2023 10:13
quadratic bezier curve length in javascript
/*
* http://en.wikipedia.org/wiki/B%C3%A9zier_curve
* http://www.malczak.linuxpl.com/blog/quadratic-bezier-curve-length/g
*/
function Point(x, y) {
this.x = x;
this.y = y;
}
@tunght13488
tunght13488 / generate-ovpn.sh
Last active March 7, 2016 11:51
Generate unified OpenVPN client profile
#!/bin/sh
# Follow https://www.digitalocean.com/community/tutorials/how-to-set-up-an-openvpn-server-on-ubuntu-14-04
# Use to quickly generate a client.ovpn file and copy it to destination folder
# Sample: sudo ./generate-ovpn.sh digital-ocean /home/myusername/openvpn
CLIENT="$1"
DEST="$2"
OPENVPN_HOME=/etc/openvpn
@tunght13488
tunght13488 / docker-keygen
Last active March 7, 2016 11:52
Generate docker certs
#!/bin/sh
echo "[$0] Working dir: $PWD"
echo 01 | tee ca.srl
# Create private key ca-key.pem
openssl genrsa -des3 -out ca-key.pem
server {
include port/http.conf;
# listen 8080;
server_name laravel.dev;
root /path/to/laravel/public;
index index.php index.html;
@tunght13488
tunght13488 / nginx.conf
Created July 17, 2015 04:12
nginx.conf
#user nobody;
worker_processes 2;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
@tunght13488
tunght13488 / magento.nginx.conf
Created July 17, 2015 11:48
magento.nginx.conf
location / {
index index.html index.php; ## Allow a static html file to be shown first
try_files $uri $uri/ @handler; ## If missing pass the URI to Magento's front handler
expires 30d; ## Assume all files are cachable
}
## These locations would be hidden by .htaccess normally
location ^~ /app/ { deny all; }
location ^~ /includes/ { deny all; }
location ^~ /lib/ { deny all; }