Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script language = "php">
session_start();
include("../admin/webconf.php");
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

Falsehoods programmers believe about prices

  1. You can store a price in a floating point variable.
  2. All currencies are subdivided in 1/100th units (like US dollar/cents, euro/eurocents etc.).
  3. All currencies are subdivided in decimal units (like dinar/fils)
  4. All currencies currently in circulation are subdivided in decimal units. (to exclude shillings, pennies) (counter-example: MGA)
  5. All currencies are subdivided. (counter-examples: KRW, COP, JPY... Or subdivisions can be deprecated.)
  6. Prices can't have more precision than the smaller sub-unit of the currency. (e.g. gas prices)
  7. For any currency you can have a price of 1. (ZWL)
  8. Every country has its own currency. (EUR is the best example, but also Franc CFA, etc.)
@magussiro
magussiro / Readme.txt
Created August 21, 2018 14:24 — forked from tony1223/Readme.txt
Generating iOS P12 / certs without Mac OSX Keychain (on linux, windows, etc)
1) Generate a private key and certificate signing request:
openssl genrsa -out ios_distribution.key 2048
openssl req -new -key ios_distribution.key -out ios_distribution.csr -subj '/emailAddress=me@example.com, CN=Example, C=US'
2) Upload CSR to apple at: https://developer.apple.com/account/ios/certificate/create
- choose Production -> App Store and Ad Hoc
3) Download the resulting ios_distribution.cer, and convert it to .pem format:
@magussiro
magussiro / httpserver.sh
Created March 21, 2020 14:41 — forked from upperstream/httpserver.sh
Simple HTTP Server (shell script)
#!/bin/sh
#
# Copyright (C) 2017 Upper Stream.
#
# See the bottom of this file for licensing conditions.
#
#set -x
set -e
@magussiro
magussiro / Python3, Pip3, Virtualenv and Virtualenvwrapper Setup
Created June 29, 2020 01:52 — forked from IamAdiSri/Python3, Pip3, Virtualenv and Virtualenvwrapper Setup
Setting up and using Python3, Pip3, Virtualenv (for Python3) and Virtualenvwrapper (for Python3)
First install pip for Python2. Download the get-pip.py file from https://bootstrap.pypa.io/get-pip.py
$ cd <download location>
$ sudo -H python ./get-pip.py
Installing pip also installs Python3
To run Python3
$ python3
Install pip3 by just executing the same file as in the step above, but this time using Python3
$ sudo -H python3 ./get-pip.py
@magussiro
magussiro / xss_notes.md
Created July 17, 2020 15:08 — forked from jaceju/xss_notes.md
XSS 上課筆記

XSS 上課筆記

OWASP

  1. Injection
  2. Broken Authentication and Session Management
  3. XSS

Devcore

<?php
trait Singleton
{
protected static $_instance = null;
public static function getInstance()
{
if (static::$_instance === null
|| !(static::$_instance instanceof static)) {
@magussiro
magussiro / create_zf_project.sh
Created July 17, 2020 15:11 — forked from jaceju/create_zf_project.sh
利用專案樣版在 Subversion 中建立一個 Zend Framework 專案
#!/bin/bash
# Program:
# 利用專案樣版在 Subversion 中建立一個 Zend Framework 專案
# History:
# 2011/11/03 Jace Ju First release
# Usage:
# Create template of project at first time:
# > cd /path/to/project_template
# > mkdir branches
# > mkdir tags
@magussiro
magussiro / example.php
Created July 17, 2020 15:16 — forked from jaceju/example.php
物件導向基礎與物件導向設計入門
<?php
abstract class Database
{
public function __construct()
{
$this->connect();
}
abstract public function connect();
@magussiro
magussiro / shell_array.sh
Created July 17, 2020 15:17 — forked from jaceju/shell_array.sh
Shell Script 的陣列範例
#!/bin/bash
versions=("5.6.24" "7.0.9")
function say()
{
value=$1
echo -e "php-$value\n"
}