Skip to content

Instantly share code, notes, and snippets.


Artyum artyuum

Block or report user

Report or block artyuum

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile

How to install Laravel globally in Ubuntu


Open your terminal using Ctrl+Alt+T and type the following commands

Step 1: Install Laravel

composer global require "laravel/installer"
View subscriptions.opml
<?xml version="1.0" encoding="UTF-8"?>
<opml version="1.0">
<title>Subscriptions -</title>
<outline text="PHP" title="PHP">
<outline htmlUrl="" title="" xmlUrl="" type="rss" text=""/>
<outline htmlUrl="" title="" xmlUrl="" type="rss" text=""/>
<outline title="" xmlUrl="" type="rss" text=""/>
lenybernard / XliffFixerCommand.php
Created Jan 26, 2017
Symfony console command to parse xliff files to add or update missing id attribute
View XliffFixerCommand.php
namespace AppBundle\Command;
use Doctrine\ORM\EntityManager;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
muhammadghazali / What is
Last active Oct 2, 2019
Nginx: What is server_names_hash_bucket_size?
View What is


While I'm learning how to use Nginx, I was instructed to update the server_names_hash_bucket_size (/etc/nginx/nginx.conf) value from 32 to 64, but I don't understand why should I increase the value to 64.


References that have been read so far:

joepie91 /
Last active Oct 11, 2019
Secure random values (in Node.js)

Not all random values are created equal - for security-related code, you need a specific kind of random value.

A summary of this article, if you don't want to read the entire thing:

  • Don't use Math.random(). There are extremely few cases where Math.random() is the right answer. Don't use it, unless you've read this entire article, and determined that it's necessary for your case.
  • Don't use crypto.getRandomBytes directly. While it's a CSPRNG, it's easy to bias the result when 'transforming' it, such that the output becomes more predictable.
  • If you want to generate random tokens or API keys: Use uuid, specifically the uuid.v4() method. Avoid node-uuid - it's not the same package, and doesn't produce reliably secure random values.
  • If you want to generate random numbers in a range: Use random-number-csprng.

You should seriously consider reading the entire article, though - it's



Everyone knows it. Syncthing is the best way to sync your files. Comes with local discovery, too! Best thing ever.


Install is easy. Too easy.

RadGH / short-number-format.php
Last active Oct 20, 2019
Short Number Formatter for PHP (1000 to 1k; 1m; 1b; 1t)
View short-number-format.php
// Converts a number into a short version, eg: 1000 -> 1k
// Based on:
function number_format_short( $n, $precision = 1 ) {
if ($n < 900) {
// 0 - 900
$n_format = number_format($n, $precision);
$suffix = '';
} else if ($n < 900000) {
cirocosta /
Created Jul 9, 2015
naive http server stress tester using cURL
#### Default Configuration
show_help() {
cat << EOF
v0lkan / nginx.conf
Last active Oct 16, 2019
Configuring NGINX for Maximum Throughput Under High Concurrency
View nginx.conf
user web;
# One worker process per CPU core.
worker_processes 8;
# Also set
# /etc/security/limits.conf
# web soft nofile 65535
# web hard nofile 65535
# /etc/default/nginx
stankusl /
Created May 27, 2015
Text Excerpt PHP function


function shorten_text($text, $max_length = 140, $cut_off = '...', $keep_word = false)
    if(strlen($text) <= $max_length) {
        return $text;

    if(strlen($text) > $max_length) {
You can’t perform that action at this time.