Skip to content

Instantly share code, notes, and snippets.

View Jeckerson's full-sized avatar
Today I work hard to get a dinner!

Anton Vasiliev Jeckerson

Today I work hard to get a dinner!
View GitHub Profile
@Jeckerson
Jeckerson / row-flex.html
Created November 26, 2016 00:41
Bootstrap 3 row flex
<div class="container">
<div class="row flex-row">
<section class="col-xs-8">
<h2>News</h2>
<div class="modcon-yellow flex-grow">
<p>... some content but yellow background doesn't stretch.</p>
</div>
</section>
<section class="col-xs-4">
<h1>Welcome</h1>
@Jeckerson
Jeckerson / create-swap.sh
Created September 21, 2019 12:29
Create swap file on Linux
fallocate -l 1G /swapfile
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
echo "/swapfile none swap sw 0 0" | tee -a /etc/fstab
@Jeckerson
Jeckerson / kernel-version.sh
Created March 21, 2020 13:35
How to check the kernel version of a Linux system?
uname
# Linux
uname -a
# Linux feb1f2105a6d 4.15.0-91-generic #92-Ubuntu SMP Fri Feb 28 11:09:48 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
@Jeckerson
Jeckerson / xps-13-7390-flick.sh
Created April 9, 2020 08:50
XPS-13 7390 - Fix display flickering on any ubuntu based OS
sudo nano /etc/default/grub
# Find and comment current value
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
# Change to value below
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash i915.enable_psr=0"
sudo update-grub
reboot
@Jeckerson
Jeckerson / README.md
Last active August 6, 2020 19:29
Benchmark function usage inside for loop

Results

Run # Benchmark 1 (sec) BenchMark 2 (sec)
1 0.2886860370636 0.16710495948792
2 0.31771802902222 0.16766691207886
3 0.27882695198059 0.17383599281311
4 0.2907509803772 0.17733597755432
5 0.28123903274536 0.17464399337769
@Jeckerson
Jeckerson / gist:616769b800f0c3b54bc105c8d5a8120a
Created October 4, 2020 18:26
Upgrade MySQL 5.5 to 5.7 on CentOS 6
# Make sure yum is up-to-date
yum update yum
# Install yum-utils (it provides yum-config-manager)
yum install yum-utils
# Backup: dump all databases to all_dbs.sql
mysqldump --lock-all-tables --all-databases -uroot -ped8a5f47cbf39f0b5eda6715c85c0ae0 >/root/all_dbs.sql
# Stop MySQL daemon
@Jeckerson
Jeckerson / model-paginator-object.php
Last active May 5, 2021 09:10
Model Paginator with object instead array
<?php
declare(strict_types=1);
/**
* Change this namespace to your and put this file whenever you want,
* according to your project structure. This is just example name.
*/
namespace App\Phalcon\Paginator\Adapter;
@Jeckerson
Jeckerson / C
Last active January 21, 2021 23:02
static void zephir_get_class_ns(zval *result, zval *object, int lower)
{
int found = 0;
unsigned int i, class_length;
char *cursor, *class_name;
zval *z = Z_ISREF_P(object) ? Z_REFVAL_P(object) : object;
if (Z_TYPE_P(z) != IS_OBJECT) {
if (Z_TYPE_P(z) != IS_STRING) {
ZVAL_NULL(result);
# Run makefiles with Max CPU parallelism
# see: export MAKEFLAGS
if [[ -n "$(command -v gmake 2>/dev/null || true)" ]]; then
alias make='gmake'
fi
# Makefile flags
MAKEFLAGS="-j$(getconf _NPROCESSORS_ONLN)"
export MAKEFLAGS