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
| sub inarray | |
| { | |
| my ( $value, @array ) = @_; | |
| foreach my $arrayvalues ( @array ) | |
| { | |
| foreach my $arrayvalue ( @$arrayvalues ) | |
| { | |
| if ( $arrayvalue eq $value ) | |
| { |
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
| CREATE OR REPLACE FUNCTION friendly_date_diff( | |
| TIMESTAMP WITH TIME ZONE | |
| ) | |
| RETURNS TEXT | |
| LANGUAGE sql | |
| IMMUTABLE | |
| STRICT | |
| AS $$ | |
| SELECT CASE |
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
| <?xml version="1.0" encoding="utf-8"?> | |
| <Wix> | |
| <Product> | |
| <!-- skip licence dialog --> | |
| <UI> | |
| <Publish Dialog="WelcomeDlg" | |
| Control="Next" | |
| Event="NewDialog" | |
| Value="InstallDirDlg" | |
| Order="2">1</Publish> |
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
| #!/usr/bin/env bash | |
| # usage: watch [command] [sleep duration] | |
| while :; do | |
| clear | |
| date | |
| bash -c "$1" | |
| sleep ${2:-1} | |
| done |
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
| rem Specify the location of the new Notepad application here | |
| set NOTEPAD_APP=%~dp0notepad.exe | |
| reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe" /v "Debugger" /t REG_SZ /d "\"%NOTEPAD_APP%\" -z" /f |
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
| CREATE OR REPLACE FUNCTION reset_sequences() | |
| RETURNS void | |
| LANGUAGE plpgsql | |
| VOLATILE | |
| AS $$ | |
| DECLARE | |
| m_Record RECORD; | |
| BEGIN |
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
| CREATE OR REPLACE FUNCTION array_filter_blanks( | |
| ANYARRAY | |
| ) | |
| RETURNS ANYARRAY | |
| LANGUAGE sql | |
| IMMUTABLE | |
| STRICT | |
| AS $$ | |
| SELECT ARRAY( |
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
| if (!function_exists('get_called_class')) { | |
| /** | |
| * Gets the name of the class the static method is called in. | |
| * | |
| * @return string | |
| */ | |
| function get_called_class() { | |
| $arr = array(); | |
| $arrTraces = debug_backtrace(); |
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
| /** | |
| * Finds whether a string ends with another string | |
| * | |
| * @param string $haystack | |
| * @param string $needle | |
| * @return boolean | |
| */ | |
| function str_endswith($haystack, $needle) { | |
| $strlen = strlen($haystack); | |
| $testlen = strlen($needle); |
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
| CREATE OR REPLACE FUNCTION array_sort( | |
| text[] | |
| ) | |
| RETURNS text[] | |
| LANGUAGE sql | |
| IMMUTABLE | |
| STRICT | |
| AS $$ | |
| SELECT ARRAY( |