Have a Snippet?

Keep, track and share your code snippets with your friends

RedOctober


User Avatar

687

Location: Prague, Czech Republic
Website: https://snippets.pro
Has joined us: 5th May 2013, 04:57
Last visit: 18th October 2013, 00:53
Profile views: 1,661


CSS: Sticky footer solution Share on Vkontakte

Sticky footer solution by Steve Hatcher ... Reveal Code


PHP: Force the browser to download the file Share on Vkontakte

Force the browser to download the file instead of opening it ... Reveal Code



PHP: Determination of the country by IP Share on Vkontakte

Determination of the country by IP using geoplugin.net OR ipinfodb.com. Will return the country code in "Alpha-2 ISO 3166-1" format (a two-char code) ... Reveal Code


PHP: Determination of the browser and its version Share on Vkontakte

Determination of the browser and its version by user-agent string. ... Reveal Code


JavaScript: Texarea remaining characters counter Share on Vkontakte

Texarea remaining characters counter ... Reveal Code


PHP: Make a thumbnail screenshot of the video Share on Vkontakte

Make a thumbnail screenshot of the video using ffmpeg ... Reveal Code


PHP: Test a Password Strength Share on Vkontakte

Test a Password Strength. Will return number (1-10), or a word ("Weak", "Normal", "Good", "Awesome"). ... Reveal Code





MySQL: Vehicles (cars) database Share on Vkontakte

Vehicles database, two tables with vehicle's models and its marks ... Reveal Code


PHP: Get the user's age Share on Vkontakte

Get the user's age by date of birth ... Reveal Code


PHP: Remove an empty array elements Share on Vkontakte

Remove an empty array elements ... Reveal Code


MySQL: Removing of duplicates Share on Vkontakte

Removing of duplicates in a table ... Reveal Code


MySQL: World countries database Share on Vkontakte

World countries and their ISO 3166-1 codes ... Reveal Code


PHP: Get zodiac sign Share on Vkontakte

Get zodiac sign by birth date ... Reveal Code


PHP: Convert the timestamp to human-readable format Share on Vkontakte

Convert the timestamp to human-readable format like XX minutes ago or XX days ago. Was found here: http://stackoverflow.com/questions/2915864/php-how-to-find-the-time-elapsed-since-a-date-time ... Reveal Code


PHP: Whois query Share on Vkontakte

Whois query by Jonas John ... Reveal Code



htaccess: Rewrite URLs #2 Share on Vkontakte

Rewrite URLs with .htaccess. If you use it then URL like "http://mydomain.com/user.php?show=JohnDoe" will be equivalent to "http://mydomain.com/JohnDoe/". ... Reveal Code


Delphi: Give a new name if the file already exists Share on Vkontakte

Give a new name if the file already exists ... Reveal Code


Delphi: Get MAC address Share on Vkontakte

Get MAC address for 1st network adapter ... Reveal Code


PHP: Convert the date interval to human-readable format Share on Vkontakte

Convert the date/time interval in human-readable format ... Reveal Code


PHP: Auto-crop the image Share on Vkontakte

This class can be used to crop images by removing edges with same color. It can load a GIF, JPEG or PNG image and scans it to detect edges color, so it crops the image to remove the edge areas that have the same color around it. The cropped image is outputted in the same format as the original image. ... Reveal Code


HTML: List of US states Share on Vkontakte

List of US states with USPS official abbreviations ... Reveal Code


CSS: Different links style Share on Vkontakte

Different links style depending on the type of these links ... Reveal Code


jQuery: Growl-like messages Share on Vkontakte

Simple Growl-like messages (top-right corner of a page) ... Reveal Code


PHP: Find all the links on a page Share on Vkontakte

Find all the links on a page (except of dummy links like "#") ... Reveal Code


PHP: Check availability of a website Share on Vkontakte

Check availability of a website ... Reveal Code


JavaScript: Send a POST request Share on Vkontakte

Send a POST request in the same way as it does form's submit. Was found here: http://stackoverflow.com/questions/133925/javascript-post-request-like-a-form-submit ... Reveal Code


jQuery: Enable the button when there is text in the text field Share on Vkontakte

Enable the button ("Submit" or other) when there is text in the text field ... Reveal Code


PHP: Parse XML Share on Vkontakte

Parse XML via SimpleXML ... Reveal Code


jQuery: Scroll to top Share on Vkontakte

Scroll the page to its top ... Reveal Code


PHP: Send an HTML formatted email Share on Vkontakte

Send an HTML formatted email. Supports all HTML formatting ... Reveal Code


htaccess: Own error pages Share on Vkontakte

Own error pages via .htaccess ... Reveal Code


CSS: Cross-browser transparency Share on Vkontakte

Cross-browser transparency. Works equally well in IE, FF, Chrome, Safari and Opera. ... Reveal Code


htaccess: Rewrite URLs Share on Vkontakte

Rewrite URLs with .htaccess. If you use it then URL like "http://mydomain.com/user.php?show=JohnDoe" will be equivalent to "http://mydomain.com/user/JohnDoe/". ... Reveal Code


PHP: Execution time of the script Share on Vkontakte

Execution time of the script. Shows the text like this: "The script has been executed in 0.0090 sec." ... Reveal Code


PHP: Allow only numbers and letters Share on Vkontakte

Allow only numbers and letters using preg_match ... Reveal Code


Tracking the Facebook comments: creating and removing. You can use it to count the FB comments in the local database. ... Reveal Code


JavaScript: Email validation Share on Vkontakte

Validation of the entered email using regex ... Reveal Code


PHP: Make a clickable text Share on Vkontakte

Make a clickable text: replace all the URLs with tag ... Reveal Code


Delphi: Get temp directory Share on Vkontakte

Get Windows temp directory. Will return something like this: C:UsersMyUserNameAppDataLocalTemp ... Reveal Code



Delphi: Clear the IE cache Share on Vkontakte

Completely clean the IE cache ... Reveal Code


Delphi: Bytes formatting Share on Vkontakte

Formatting byte values to a more readable values ... Reveal Code


PHP: Determination of the OS Share on Vkontakte

Determination of the OS by user-agent string ... Reveal Code


PHP: Format a date received from MySQL Share on Vkontakte

Format a date/time received from MySQL in a more readable (user-friendly) form. ... Reveal Code


PHP: Get a single value from DB Share on Vkontakte

Get a single value from DB as a variable. ... Reveal Code


PHP: Email validation Share on Vkontakte

Validation of the entered email using preg_match ... Reveal Code


PHP: Create a permalink based on the text entered Share on Vkontakte

Simple PHP-function allows to create a permalink based on the text entered. Was found on stackoverflow.com. ... Reveal Code


Delphi: Замена подстроки в сторке Share on Vkontakte

Замена всех подстрок в данной строке. Функция была использована от Delphi 7 до Delphi XE3. ... Reveal Code


Delphi: Add a message to log Share on Vkontakte

Add a message to TRichEdit based log. Message will be in a format: [CURRENT_DATE CURRENT_TIME]: MESSAGE_TEXT ... Reveal Code


MySQL: The number of records for yesterday Share on Vkontakte

The number of records in the table for yesterday ... Reveal Code


Delphi: Get MD5 value Share on Vkontakte

Get MD5 value, in the same way as it PHP does. ... Reveal Code


MySQL: The number of records for the current month Share on Vkontakte

The number of records in a table for the current month (from 1st to current day) ... Reveal Code


PHP: Bytes formatting Share on Vkontakte

Formatting byte values to a more readable values ... Reveal Code


Delphi: Get the version of a file Share on Vkontakte

Get the version of a file. The function was used from Delphi 7 to Delphi XE3. ... Reveal Code


CSS: Box shadow Share on Vkontakte

Cross-browser CSS box shadow ... Reveal Code


CSS: Rounded corners Share on Vkontakte

Cross-browser CSS rounded corners ... Reveal Code


PHP: Custom social sharing URLs Share on Vkontakte

Custom social sharing URLs for the most popular social networks ... Reveal Code


Visual Studio: Visual Studio sample snippet Share on Vkontakte

A snippet sample in VS2005 format ... Reveal Code


PHP: Convert a date from SQL to RFC822 format Share on Vkontakte

Convert a date from SQL to RFC822 format. It may be useful for creating RSS-feed. ... Reveal Code



jQuery: Fade in then fade out Share on Vkontakte

Fade in the hidden element, wait a little bit, then fade out id. Simple but useful. ... Reveal Code


PHP: Generate a random password Share on Vkontakte

Generate a random password with an arbitrary length ... Reveal Code


PHP: Crop the image to a square Share on Vkontakte

Crop the image to a square, This function can take care of jpg, png and gif. The size of the image and the jpg-quality can be set separately, ... Reveal Code


PHP: Simple pagination

Simple PHP pagination uses a Twitter Bootstrap layout ... Reveal Code


1C 7.7: Получить название месяца Share on Vkontakte

Получить название месяца ... Reveal Code


jQuery: Display file sizes next to download links Share on Vkontakte

«jQuery Trickshots» by tutorialzine.com ... Reveal Code


1C 7.7: FTP-Обмен файлами Share on Vkontakte

Для отправки файла из 1С на фтп-сервер и обратно можно использовать бесплатную консольную программу ncftp
Страница загрузки: http://www.ncftp.com/download/
Скачать установщик фтп-клиента для Windows и установить. (там же есть исходники)
Описание параметров для PUT http://www.ncftp.com/ncftp/doc/ncftpput.html
Описание параметров для GET http://www.ncftp.com/ncftp/doc/ncftpget.html ... Reveal Code


C++: StopForumSpam

This is a complete console program compiled with Microsoft Visual Studio 2012 that demonstrates how to access the api from (SFS). The program sends a list of ip address to SFS and gets a reply that indicates which ones have been reported as spammers. The list of IP addresses is obtained from a tab deliminated file which was generated from a vBulletin forum web site. You can easily modify the program to get the list of ip address from some other stream.\r\n ... Reveal Code


JavaScript: Dumping tools and alias for development Share on Vkontakte

Use it for easy dumping variables
q() is alias for console.log()
w() is function, that displaying colorfull variable data like "var_export" to popup transparent div
based on this helpfull comment http://stackoverflow.com/a/7220510/2236189

Example: http://jsfiddle.net/ymmsA/
... Reveal Code



Delphi: Delay without blocking of the main thread Share on Vkontakte

Function delays program logic execution for a number of miliseconds, The GUI and Windows messages will continue to work. ... Reveal Code


jQuery: Get data via Ajax Share on Vkontakte

Get some data via Ajax, calling to a php-script and receiving a data. ... Reveal Code


SQL: Select Duplicates Share on Vkontakte

Select Duplicates ... Reveal Code


JavaScript: Declension of number (Склонение числительных) Share on Vkontakte

Example http://jsfiddle.net/v5nWh/ ... Reveal Code