(array_add|array_collapse|array_divide|array_dot|array_except|array_first|array_flatten|array_forget|array_get|array_has|array_last|array_only|array_pluck|array_prepend|array_pull|array_random|array_set|array_sort_recursive|array_sort|array_where|array_wrap|camel_case|ends_with|kebab_case|snake_case|starts_with|str_after|str_before|str_contains|str_finish|str_is|str_limit|str_plural|str_random|str_replace_array|str_replace_first|str_replace_last|str_singular|str_slug|str_start|studly_case|title_case)
This file contains 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
Function StringConcat(Sep As String, ParamArray Args()) As Variant | |
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' | |
' StringConcat | |
' By Chip Pearson, chip@cpearson.com, www.cpearson.com | |
' www.cpearson.com/Excel/stringconcatenation.aspx | |
' This function concatenates all the elements in the Args array, | |
' delimited by the Sep character, into a single string. This function | |
' can be used in an array formula. There is a VBA imposed limit that | |
' a string in a passed in array (e.g., calling this function from | |
' an array formula in a worksheet cell) must be less than 256 characters. |
This file contains 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
<?php | |
$input = $argv[1] ?? 'snippets.csv'; | |
$file = fopen($input, 'r'); | |
$outputDir = pathinfo($input, PATHINFO_FILENAME); | |
$snippetFiles = []; | |
// Make the temp output directory | |
if (! file_exists($outputDir)) { |
This file contains 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
function arrayToTable(array $values, array $headers = []) | |
{ | |
$options = [ | |
'tableStyle' => 'border: 1px solid black;border-collapse: collapse;', | |
'thStyle' => 'border: 1px solid black;padding: 5px 7px;text-align: center;', | |
'tdStyle' => 'border: 1px solid black;padding: 5px 7px;text-align: center;', | |
]; | |
$th = "<th style='" . $options['thStyle'] . "'>"; | |
$td = "<td style='" . $options['tdStyle'] . "'>"; |
This file contains 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
<?php | |
$host = 'palindromer-bd7e0fc867d57915.elb.us-east-1.amazonaws.com'; | |
$port = 7777; | |
$socket = fsockopen($host, $port); | |
if (! $socket) { | |
die('Error: connection not successful'); | |
} |
This file contains 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
Chrome/Windows: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36 | |
Chrome/Windows: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36 | |
Chrome/Windows: Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36 | |
Chrome/macOS: Mozilla/5.0 (Macintosh; Intel Mac OS X 11_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36 | |
Chrome/Linux: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36 | |
Chrome/iPhone: Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/87.0.4280.77 Mobile/15E148 Safari/604.1 | |
Chrome/iPhone (request desktop): Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_5) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/87 Version/11.1.1 Safari/605.1.15 | |
Chrome/iPad: Mozilla/5.0 (iPad; CPU OS 14_3 like Mac OS X) AppleWebKit/605.1.1 |
This file contains 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
#!/bin/bash | |
# Base box setup steps | |
# Do the steps below as root user | |
sudo su | |
# The steps below are based on a clean install on | |
# CentOS 7 (build 1608) | |
# http://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud-1608.raw.tar.gz |
This file contains 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
<?php | |
/** | |
* Calculate the distance between two points on a sphere | |
* | |
* Implements the Haversine formula: http://en.wikipedia.org/wiki/Haversine_formula | |
* | |
* More advanced calculation (good for antipodal points) can be used by using | |
* FALSE for $boolUseHaversine. This will use another solution to the Great-circle | |
* ditance problem (http://en.wikipedia.org/wiki/Great-circle_distance), implementing | |
* the Vincenty formula (http://en.wikipedia.org/wiki/Vincenty%27s_formulae#Nearly_antipodal_points). |
This file contains 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
<?php | |
/** | |
* Post a message from a bot to a group | |
* | |
* $groupId (string) GroupId of the group to post the message | |
* $strMessage (string) Text of the message to post (limit of 1000 characters) | |
* $strBotId (string) ID of the bot which will post the message | |
* $mentionUsers (array) [optional] array of userIds to mention (uses attachment) | |
* Example array of userIds: |
This file contains 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
-- Clear the console | |
hs.console.clearConsole() | |
-- Set the default grid | |
hs.grid.MARGINX = 0 | |
hs.grid.MARGINY = 0 | |
hs.grid.GRIDWIDTH = 20 | |
hs.grid.GRIDHEIGHT = 100 | |
-- Also can be set using hs.grid.setGrid'20x100' |