Skip to content

Instantly share code, notes, and snippets.

@manniru
manniru / codegolf.md
Created January 29, 2020 05:31 — forked from xem/codegolf.md
JS code golfing

codegolf JS

Mini projects by Maxime Euzière (xem), subzey, Martin Kleppe (aemkei), Mathieu Henri (p01), Litterallylara, Tommy Hodgins (innovati), Veu(beke), Anders Kaare, Keith Clark, Addy Osmani, bburky, rlauck, cmoreau, maettig, thiemowmde, ilesinge, adlq, solinca, xen_the,...

(For more info and other projects, visit http://xem.github.io)

(Official Slack room: http://jsgolf.club / join us on http://register.jsgolf.club)

{ (this.state.subheads.length == 0) ? <div className="overlay"><i className="fas fa-2x fa-sync-alt" /></div> : '' }
@LukeMathWalker
LukeMathWalker / audit.yml
Last active May 1, 2024 12:27
GitHub Actions - Rust setup
name: Security audit
on:
schedule:
- cron: '0 0 * * *'
push:
paths:
- '**/Cargo.toml'
- '**/Cargo.lock'
jobs:
security_audit:
#!/bin/bash
# Get host ip4 of interface eth0/en0/eth1.
# For linux, eth0 inet.
ifconfig eth0 >/dev/null 2>/dev/null && ip -4 addr show scope global dev eth0| grep inet| awk '{print $2}' && exit 0
# For linux, eth1 inet.
ifconfig eth1 >/dev/null 2>/dev/null && ip -4 addr show scope global dev eth1| grep inet| awk '{print $2}' && exit 0
@manniru
manniru / README.md
Created April 26, 2020 08:50 — forked from maqnouch/README.md
Signal Installation Steps

Signal Server Installation Guide

Author: Aqnouch Mohammed aqnouch.mohammed@gmail.com

Abstract

This paper is a quickstart for anyone aims to setup a working Signal Server.

What Is Signal

Signal is an encrypted instant messaging and voice calling application for Android. It uses the Internet to send one-to-one and group messages, which can include images and video messages, and make one-to-one voice calls. Signal uses standard phone numbers as identifiers and end-to-end encryption to secure all communications to other Signal users.

$count_query = clone $query;
$arr = $count_query->execute()->fetchAllAssoc('id', \PDO::FETCH_ASSOC);
$sum_array = array_sum(array_column($arr, 'amount'));
print('<pre>' . print_r($sum_array, TRUE) . '</pre>'); exit();
<?php
namespace Drupal\system\Controller;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpFoundation\Response;
use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
use Drupal\system\SystemManager;
/**
sudo nano ~/.zshrc
export PATH=/Applications/XAMPP/xamppfiles/bin:$PATH
export PATH
source ~/.zshrc
https://stackoverflow.com/questions/18305909/get-previous-array-key-in-associative-array
$keys = array_keys($entries[0]);
echo "<table><tr><th>".implode("</th><th>", $keys)."</th></tr>";
foreach ($entries as $order) {
if (!is_array($order))
continue;
echo "<tr><td>".implode("</td><td>", $order )."</td></tr>";
}
echo "</table>";
exit();