Code Snippets Submitted by David Villa

Example Apache .htaccess file to add access control header

This function is used to reverse an integer array. For example, if the array is {1,2,3,4,5}, these functions will return an array like {5,4,3,2,1}. The user needs to pass in a pointer to the array and the size of the array, and the function will return a pointer to an array in the reverse order.

Python functions are naturally polymorphic on their arguments, and checking argument types loses polymorphism

26 November, 2015   

Show the currently active processes.

10 September, 2011   

Example of adding a constraint

24 July, 2016   

Dynamically add form fields to your forms.

10 September, 2011   

Example code showing how to add a primary constraint. This Oracle constraint is used to identify the primary key for a table. A primary key is a single field or combination of fields that uniquely defines a record. None of the fields that are part of the primary key can contain a null value. A table can have only one primary key. This...

21 September, 2011   

Allows you to add a string to end or start of a field to use when comparing or selecting data. The second argument is added to the end of the first

29 April, 2015   

Advanced "Go to Top" link using JavaScript and HTML anchors

13 December, 2011   

You can use to find and replace text in a variable. This script created by Bruce Phillips, one of the leading posters at MacScripter.

24 September, 2012   

An array of states to convert "AL" for example to "Alabama"

19 January, 2014   

It consist of Lights effect, Sound Effect. Press 'L' for Lights effect and 'H' for Horn.

13 September, 2015   

C code snippet for another merge sort of integer list

13 December, 2011   

Chooses a pre-determined playlist from your iTunes library

This Applescript take the selected file in Finder and open it with Sublime Text 2 (~/bin/subl). Using Alfred you can bind a global hotkey for this script, so you can edit your files with just a keypress, without worrying about the default editor.

13 July, 2013   

C programming code to check whether a number is armstrong or not.

01 April, 2015   

PHP code example for using the array_walk function to format an array.

13 February, 2013   

PHP Code example for ASCII CAPTCHA

12 January, 2012   

Here shown a php code example how to associative Array by Column Name

06 October, 2012   

Tested on multiline textbox and listview.