Instantly share code, notes, and snippets.

View HowToSlackDark.md

🔥 How to "Hack" Slack to get a dark theme. 🔥

Slack Dark Theme

❗️ Close Slack if it's running ❗️

Installing theme

In your favorite text editor, open the following file :

  • Windows C:\Users\<USERNAME>\AppData\Local\slack\app-<VERSION>\resources\app.asar.unpacked\src\static\ssb-interop.js
View benchmark-for-vs-foreach.php
<?php
$a = array();
for ($i = 0; $i < 100000; $i++) {
$a[] = $i;
}
$start = microtime(true);
foreach ($a as $k => $v) {
$a[$k] = $v + 1;
}
View convertSameCaracterToSameAscii.php
<?php
/*
* Accept array or string
*/
function convertSameCaracterToSameAscii($string)
{
$tab_chr = array() ;
for($control = 0; $control < 32; $control++) {
if ($control != 9 && $control != 10) {
$tab_chr[]= chr($control) ;
View getClosestLowerValue.php
<?php
function valueExpected ($analyse, $expect, $strict = false)
{
if ($strict)
{
if ($analyse === $expect)
{
return '<span style="background-color:darkolivegreen; color:darkgrey;">Received : ' .
$analyse .
', Expected : ' .
View wpex_pagination.php
/*
* Numbered Pagination
* http://www.wpexplorer.com/pagination-wordpress-theme/
*/
if ( !function_exists( 'wpex_pagination' ) ) {
function wpex_pagination($wpex_query) {
$prev_arrow = is_rtl() ? '&rarr;' : '&larr;';
$next_arrow = is_rtl() ? '&larr;' : '&rarr;';
/*