Welcome To Snipplr
Everyone's Recent Snippets Tagged format
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
Nice script for formatting dates in a batch file without having the system locale settings impact your format
0
1184
posted 10 years ago by kidmizere
This technical tip shows how each TIFF frame can be converted to JPEG and then these images to PDF file using Aspose.Pdf for Java. Aspose.Pdf for Java is very well capable of dealing with TIFF images and can easily transform them into PDF format. How...
0
1603
posted 10 years ago by johansonkatherine
Todays dates are shown as hh:mm, dates from yesterday and earlier as dd mmm.
This can be useful, since recent dates are showing more details
0
1075
posted 11 years ago by lakkie
A quick function that makes it easy to convert an integer into a number string with commas inserted.
0
815
posted 11 years ago by uberdragon
Breaks up an address (in this case returned by Advanced Custom Fields Location plugin) into it's components. Additionally, sorts a multidimensional array of locations alphabetically by state. This works for basic addresses assuming that address is in...
1
868
posted 11 years ago by devowhippit
Generic function - Pass the context to the function for use with any field
0
818
posted 11 years ago by chetkloss
Use: echo format_size(filesize("fichier"));
Example result: 13,37 Ko
0
890
posted 12 years ago by zhyar
this is a snippet from a parsing piece of code I had to do for class, basically I had to grab employee names, numbers, paycodes, hours worked, etc. and organize it. In order to align the columns I ended up using some code like this
0
891
posted 12 years ago by nickstanish
Reference of simple operations with dates, such as formatting and arithmetic.
0
875
posted 13 years ago by denakitan
A custom class for formatting dates, similar to PHP bult-in function "date". The class also has some other date utils functions, like: dayOfYear, numberOfDaysInMonth, etc..
1
1086
posted 13 years ago by TimoZachi
Thanks to http://www.mredkj.com/javascript/numberFormat.html#addcommas
0
691
posted 13 years ago by fengelz
Example call: $menuName = sleek_get_theme_menu_name('footer-menu')
0
1095
posted 13 years ago by Huskie
I was working on a project where the timestamp string I was getting from the backend developer was pretty dirty in the way it was formatted. For example, it looked like "/Date(1310127448000+0100)/". I needed to get a nicely formatted time from it in...
0
1186
posted 13 years ago by adrianparr
For this to work you need the as3corelib classes from here ... https://github.com/mikechambers/as3corelib
0
2747
posted 13 years ago by adrianparr
This example expects there to be a dynamic textfield on the stage with the instance name of 'myTextFieldOnStage'. Remember to embed the fonts (Numerals and Colon).
0
1543
posted 13 years ago by adrianparr
Format a date into a string using several string variables.
Usage:
(new Date("6/6/2011")).format("%W, %B %d%o, %Y");
Result:
Monday, June 6th, 2011
0
1048
posted 13 years ago by wizard04
First command shows connected drives, may not be mounted.
Second command formats the drive.
0
718
posted 13 years ago by loungerdork
This function shows how you can format a double value to a string with a given precision.
0
862
posted 13 years ago by bits
The date format is dd/mm/YYYY but you can replace slashes by anything else.
0
804
posted 13 years ago by ptiswitz
Excel macro to copy values from formated cells. For example:
If you have a sheet that has huge numbers in millions for example 1,312,323 and you apply a format to the cell such that only 1.3 is displayed, if you want to copy 1.3 and put it in a da...
1
923
posted 13 years ago by abhisood