Skip to content

Instantly share code, notes, and snippets.

View epicsagas's full-sized avatar
🎯
Focusing

Sangseng Lee epicsagas

🎯
Focusing
View GitHub Profile
@amura2406
amura2406 / IntallPerconaOSX.md
Last active June 13, 2019 03:05
Steb-by-Step to Install Percona Server (Alternative to MySQL) on Mac OS X 10.11.6 (El Capitan)

Install percona-server.

Install from homebrew

brew install percona-server

chown /usr/local

sudo chown -R <username> /usr/local
@andyjessop
andyjessop / React state management with RxJS.md
Last active May 7, 2020 22:34
React state management with RxJS

This is an example of how to use RxJS to manage state within a React app.

  • The service exposes an emitter that emits the entire state whenever a change is made.
  • The React component then calls setState() with the new state.
  • The service is passed down via props so that child components can access mutator methods.
@molotovbliss
molotovbliss / mysql-large-db-import
Created November 29, 2016 18:05
Importing Large DB faster MySQL Settings
Source: https://dba.stackexchange.com/questions/83125/mysql-any-way-to-import-a-huge-32-gb-sql-dump-faster
innodb_buffer_pool_size = 4G
innodb_log_buffer_size = 256M
innodb_log_file_size = 1G
innodb_write_io_threads = 16
innodb_flush_log_at_trx_commit = 0
Why these settings ?
innodb_buffer_pool_size will cache frequently read data
@BlueNexus
BlueNexus / python2pseudo.py
Last active July 3, 2025 10:56
Python to Pseudocode converter
import os.path
import re
'''
INSTRUCTIONS
1. Create a file with the following code
2. Put the file you want to convert into the same folder as it, and rename it to "py_file.py"
3. Add a "#F" comment to any lines in the code which have a function call that doesn't assign anything (so no =),
as the program cannot handle these convincingly
4. Run the converter file
@simonhamp
simonhamp / AppServiceProvider.php
Last active August 4, 2025 20:56
A pageable Collection implementation for Laravel
<?php
namespace App\Providers;
use Illuminate\Support\Collection;
use Illuminate\Pagination\LengthAwarePaginator;
class AppServiceProvider extends ServiceProvider
{
public function boot()
@iamstoick
iamstoick / php.md
Created July 26, 2017 07:03
How to check an average memory usage by single PHP-FPM process
ps --no-headers -o "rss,cmd" -C php-fpm | awk '{ sum+=$1 } END { printf ("%d%s\n", sum/NR/1024,"M") }'
ps --no-headers -o "rss,cmd" -C apache2 | awk '{ sum+=$1 } END { printf ("%d%s\n", sum/NR/1024,"M") }'
@cdleon
cdleon / macbook-pro-2011-defective-gpu-fix.md
Last active July 22, 2025 01:39
Macbook Pro 2011 GPU Defect fix macOS Sierra and High Sierra
@pbredenberg
pbredenberg / phpenv-osx.sh
Last active April 5, 2020 09:20 — forked from christopher-hopper/phpenv-macos.sh
Install phpenv on OSX from homebrew packages.
#!/usr/bin/env bash
# vim: ai ts=2 sw=2 et sts=2 ft=sh
# Use this script to install or re-install
# multiple versions of PHP on MacOS.
#
# Usage:
# curl -L https://git.io/v52yY | bash
# Check OS.
@shinebayar-g
shinebayar-g / Fix redis server startup warnings, redis tuning performance on Ubuntu 16.04.md
Last active July 13, 2023 01:17
Fix redis server startup warnings, redis tuning performance on Ubuntu 16.04
  • Maximum Open Files
You requested maxclients of 10000 requiring at least 10032 max file descriptors.
Server can't set maximum open files to 10032 because of OS error: Operation not permitted.
Current maximum open files is 4096. maxclients has been reduced to 4064 to compensate for maxclients has been reduced to 4064 to compensate for low ulimit. If you need higher maxclients increase 'ulimit -n'.
@thehesiod
thehesiod / 1pass_dups.py
Last active December 21, 2024 15:18
1password duplicate remover (alpha, only run in debugger with breakpoints everywhere *g*)
#!/usr/bin/env python3
import json
import subprocess
import sys
from concurrent.futures import ThreadPoolExecutor
import html
import dictdiffer
import iso8601