Welcome To Snipplr


Everyone's Recent Snippets Tagged function



« Prev 1 2 3 4 5 6 7
Submit function for Foundation framework
0 627 posted 8 years ago by envane21
Calculates the center moving average for a time period. The vA requires a range or an array of numbers and the iSteps takes the number of periods in the timeframe (4 for quarters, 7 for weekly, ect)
1 1056 posted 8 years ago by BDOGG32
Uses regular expressions to do string manipulation. Enter a regular expression into the required parameter and what you want the manipulation to do and it will process the string manipulation. For example if A1 contains John Doe1, Jane Doe2, John W...
2 907 posted 8 years ago by BDOGG32
This snippet allows to know the parent function caller name of any level from the calling function.
1 584 posted 9 years ago by zandor
use anonymous function that returns parameter passed to it to evaluate functions, constants, and expressions in HEREDOC
0 839 posted 9 years ago by Queue
used ceil instead floor
0 613 posted 10 years ago by Balamir
For example, in a button, in OnClientClick method, pass parameters for a javascript method.
0 1475 posted 10 years ago by keidash
Find a key from a list of values​​. parameters: sbValues​​: List of Values 'A;B;C;D' sbToken: Key 'B' sbSeparator: ',' or any defined sbValues Example: select FSBFINDTOKEN('A;B;C;D','B',';') from DUAL; ------------------- Y
0 726 posted 10 years ago by ceduard0
If you know a libref or fileref, the PATHNAME function can be used to return the physical location. If the libref refers to more than one physical location, all of those locations will be returned, in quotes, separated by spaces, with the whole li...
0 822 posted 10 years ago by webonomic
Checks if two given arrays equal each other as php doesn't have a built in function for this.
0 601 posted 11 years ago by MaxHudson
To set cookie use "cookie('name of your cookie','cookie data','expire date ')" it will set your cookie in the user browser . To get the saved cookie use "cookie('name of your cookie')" it will give you the value of the cookie which you saved in the...
0 595 posted 11 years ago by kameshsoft
A simple template for a JavaScript function which allows for an arbitrary number of named arguments to be passed in. This is achieved by passing a single object as an argument with each of the 'real' arguments being a key/value pair. In this way argu...
0 1089 posted 11 years ago by davidwaterston
This is a method that can be used to take a connection string and a valid oledb command and perform a scalar. This returns an Integer/Int32 value.
0 783 posted 11 years ago by nimblebits
goes in the functions file
0 634 posted 11 years ago by thesmu
This function dosen't use curl, or any other libraries. Just include it in your function library and use it like this: $Post_result = _post('http://www.yourdomain.com/your_path/post_api.php',"method=fetchJson&params=select * from user");
0 781 posted 11 years ago by halk
Set the desired date within the function. Make some images and label them "1.jpg, 2.jpg, 3.jpg, etc...". That's how it's done.
1 700 posted 11 years ago by o0110o
This function will force a file to be downloaded. It accepts $_path as a parameter.
1 753 posted 11 years ago by o0110o
This function performs several checks to make sure it's getting the correct IP address.
1 984 posted 11 years ago by o0110o
A handy function to get the contents of a file with curl. Accepts $_path as a parameter.
1 889 posted 11 years ago by o0110o
This function will use curl to see if a file exists at the location it's provided. It accepts $_path as a parameter.
1 1021 posted 11 years ago by o0110o
A function to get a files size via curl. Accepts $_path, $_unit, $_float, $_username & $_password; In the listed order.
1 1036 posted 11 years ago by o0110o
This is a function to retrieve the mime-type of a file by checking the header response with curl. It accepts the file-path as a parameter & it also has a fallback for empty returns.
1 1246 posted 11 years ago by o0110o
Use: echo format_size(filesize("fichier")); Example result: 13,37 Ko
0 671 posted 11 years ago by zhyar
I wanted to make a function / method and pass a var to it form another class.
0 819 posted 11 years ago by kutyadog
Convert 12-hour time format with hour, minutes, seconds, and meridiem into 24-hour format. Performs data correction to make sure hours, minutes and seconds have leading zeros if needed. The trick here is to use strtotime() where we pass the time...
0 3636 posted 11 years ago by kosinix
Simulate the $_GET array from php in javascript to get url parameters this way: url= http://localhost/?var1=example $_GET['var1'] will return "example" Just copy and paste the code.
2 885 posted 11 years ago by sergiazow
Function to prevent sql injection in Like queries, where the characters '_' and '%' can be dangerous.
0 843 posted 11 years ago by TimoZachi
Clear all text fields on focus based on original value with single function. The code checks for a 'title' attribute on each input with class 'text' and compares this to the current value of the field.
0 840 posted 11 years ago by Huskie
Complete initialization for the new calendar class
0 656 posted 11 years ago by jdhall75
In this purely constructed example, we create anonymous function and use call to invoke it on every object in an array. The main purpose of the anonymous function here is to add a print function to every object, which is able to print the right index...
0 735 posted 11 years ago by hellowouter
« Prev 1 2 3 4 5 6 7