This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /* creates a compressed zip file */ | |
| function create_zip($files = array(), $destination = '', $overwrite = false) { | |
| //if the zip file already exists and overwrite is false, return false | |
| if(file_exists($destination) && !$overwrite) { return false; } | |
| //vars | |
| $valid_files = array(); | |
| //if files were passed in... | |
| if(is_array($files)) { | |
| //cycle through each file |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /*====================================*/ | |
| /*=== Send email with attachment ====*/ | |
| /*====================================*/ | |
| function mail_attachment($to, $subject, $message, $from, $file, $reply_to) { | |
| // $file should include path and filename | |
| $filename = basename($file); | |
| $file_size = filesize($file); | |
| $content = chunk_split(base64_encode(file_get_contents($file))); | |
| $uid = md5(uniqid(time())); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /*====================================*/ | |
| /*=== Determine numbers HTML codes ===*/ | |
| /*====================================*/ | |
| function NumbertoHtmlCodes($number){ | |
| $number = (int)$number; | |
| if ($number === 0) { | |
| $html = "0"; | |
| }elseif ($number === 1) { | |
| $html = "1"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function detect_utf_encoding($data) { | |
| $UTF32_BIG_ENDIAN_BOM = chr(0x00) . chr(0x00) . chr(0xFE) . chr(0xFF); | |
| $UTF32_LITTLE_ENDIAN_BOM = chr(0xFF) . chr(0xFE) . chr(0x00) . chr(0x00); | |
| $UTF16_BIG_ENDIAN_BOM = chr(0xFE) . chr(0xFF); | |
| $UTF16_LITTLE_ENDIAN_BOM = chr(0xFF) . chr(0xFE); | |
| $UTF8_BOM = chr(0xEF) . chr(0xBB) . chr(0xBF); | |
| $first2 = substr($data, 0, 2); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $extensions = array(); | |
| $extensions = json_decode('{"JavaScript+Mako":[["js+mako","javascript+mako"],[],["application\/x-javascript+mako","text\/x-javascript+mako","text\/javascript+mako"]],"Brainfuck":[["brainfuck","bf"],["bf","b"],["application\/x-brainfuck"]],"HTML+Cheetah":[["html+cheetah","html+spitfire"],[],["text\/html+cheetah","text\/html+spitfire"]],"Bash":[["bash","sh","ksh"],["sh","ksh","bash","ebuild","eclass"],["application\/x-sh","application\/x-shellscript"]],"CSS+Myghty":[["css+myghty"],[],["text\/css+myghty"]],"Coldfusion HTML":[["cfm"],["cfm","cfml","cfc"],["application\/x-coldfusion"]],"Smarty":[["smarty"],["tpl"],["application\/x-smarty"]],"Protocol Buffer":[["protobuf"],["proto"],[]],"ApacheConf":[["apacheconf","aconf","apache"],[".htaccess","apache.conf","apache2.conf"],["text\/x-apacheconf"]],"Java":[["java"],["java"],["text\/x-java"]],"JavaScript+Genshi Text":[["js+genshitext","js+genshi","javascript+genshitext","javascript+genshi"],[],["application\/x-javascript+genshi","text\/x |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # conky configuration | |
| # | |
| # The list of variables has been removed from this file in favour | |
| # of keeping the documentation more maintainable. | |
| # Check http://conky.sf.net for an up-to-date-list. | |
| # | |
| # For ideas about how to modify conky, please see: | |
| # http://crunchbanglinux.org/forums/topic/59/my-conky-config/ | |
| # | |
| # For help with conky, please see: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package mysqlinsert.solr; | |
| import java.io.IOException; | |
| import java.sql.Connection; | |
| import java.sql.DriverManager; | |
| import java.sql.PreparedStatement; | |
| import java.sql.Statement; | |
| import java.util.Properties; | |
| import org.apache.solr.common.SolrInputDocument; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /* | |
| * Copyright 2011 Michael Cutler <m@cotdp.com> | |
| * | |
| * Licensed under the Apache License, Version 2.0 (the "License"); | |
| * you may not use this file except in compliance with the License. | |
| * You may obtain a copy of the License at | |
| * | |
| * http://www.apache.org/licenses/LICENSE-2.0 | |
| * |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Updated code from comments | |
| function encode($value) { | |
| if (!$value) { | |
| return false; | |
| } | |
| $key = sha1('EnCRypT10nK#Y!RiSRNn'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function getsign($day,$month) { | |
| if(($month==1 && $day>20)||($month==2 && $day<20)) { | |
| $mysign = "aquarius"; | |
| } | |
| if(($month==2 && $day>18 )||($month==3 && $day<21)) { | |
| $mysign = "pisces"; | |
| } | |
| if(($month==3 && $day>20)||($month==4 && $day<21)) { | |
| $mysign = "aries"; |