Skip to content

Instantly share code, notes, and snippets.

Prisacari Dmitrii icamys

Block or report user

Report or block icamys

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
nikhita /
Last active Sep 15, 2019
How to update the Go version

How to update the Go version

System: Debian/Ubuntu/Fedora. Might work for others as well.

1. Uninstall the exisiting version

As mentioned here, to update a go version you will first need to uninstall the original version.

To uninstall, delete the /usr/local/go directory by:

deleugpn / DuskServeCommand.php
Last active Apr 12, 2018
Run php artisan serve before running php artisan dusk in a single console command.
View DuskServeCommand.php
namespace App\Console\Commands;
use RuntimeException;
use Laravel\Dusk\Console\DuskCommand;
use Symfony\Component\Process\Process;
use Symfony\Component\Process\ProcessBuilder;
class DuskServeCommand extends DuskCommand {
citrusui /
Last active Sep 14, 2019
"Dropdowns" in Markdown
How do I dropdown?
This is how you dropdown.

<summary>How do I dropdown?</summary>
This is how you dropdown.
marians /
Last active Aug 7, 2019
The missing Python couchdb tutorial

This is an unofficial manual for the couchdb Python module I wish I had had.


pip install couchdb

Importing the module

shovon /
Created Apr 10, 2015
Increasing swap size. Only tested on the ubuntu/trusty64 Vagrant box. CREDIT GOES TO --->
# size of swapfile in megabytes
# does the swap file already exist?
grep -q "swapfile" /etc/fstab
# if not then create it
if [ $? -ne 0 ]; then
View mb_substr_replace.php
* @param mixed $string The input string.
* @param mixed $replacement The replacement string.
* @param mixed $start If start is positive, the replacing will begin at the start'th offset into string. If start is negative, the replacing will begin at the start'th character from the end of string.
* @param mixed $length If given and is positive, it represents the length of the portion of string which is to be replaced. If it is negative, it represents the number of characters from the end of string at which to stop replacing. If it is not given, then it will default to strlen( string ); i.e. end the replacing at the end of string. Of course, if length is zero then this function will have the effect of inserting replacement into string at the given start offset.
* @return string The result string is returned. If string is an array then array is returned.
function mb_substr_replace($string, $replacement, $start, $length=NULL) {
if (is_array($string)) {
mattes / check.go
Last active Aug 27, 2019
Check if file or directory exists in Golang
View check.go
if _, err := os.Stat("/path/to/whatever"); os.IsNotExist(err) {
// path/to/whatever does not exist
if _, err := os.Stat("/path/to/whatever"); !os.IsNotExist(err) {
// path/to/whatever exists
aczietlow /
Last active Sep 15, 2019 — forked from huangzhichong/
Cheat sheet for using php webdriver (facebook/webdriver).

Webdriver PHP API workthough

  • Open a browser

    # start an instance of firefox with selenium-webdriver
    $browser_type = 'firefox'
    $host = 'http://localhost:4444/wd/hub'
    $capabilities = array(\WebDriverCapabilityType::BROWSER_NAME => $browser_type);
alyssaq /
Created Apr 2, 2014
python multithreading
#!/usr/bin/env python
# -*- coding: utf-8 -*-
""" Sample multithreading with
Requirements: requests, bottle
To run:
$ python
To post data, open another command shell and type:
denji /
Last active Sep 14, 2019
NGINX tuning for best performance

Moved to git repository:

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

You can’t perform that action at this time.