Skip to content

Instantly share code, notes, and snippets.

val queue = CircularFifoQueue<String>(5)
queue.add("a")
queue.add("b")
queue.add("c")
queue.add("d")
queue.add("e")
queue.add("f")
queue.add("g")
queue.add("h")
queue.add("i")
Flowable.interval(1, TimeUnit.SECONDS)
.onBackpressureDrop()
.doOnNext { aLong ->
//
}
.observeOn(Schedulers.io(), true, 1)
.subscribe { aLong ->
Log.w(TAG, "onNext: TIME=" + aLong!!.toString())
// Simulate API request
@erlangparasu
erlangparasu / generate-sql-myisam-to-innodb.sql
Created May 3, 2019 18:29
generate sql to convert all tables from myisam into innodb
-- Source:
-- https://stackoverflow.com/questions/3856435/how-to-convert-all-tables-from-myisam-into-innodb/25265720#25265720
SET @DATABASE_NAME = 'YourDbName';
SELECT CONCAT('ALTER TABLE ', table_schema, '.', table_name, ' ENGINE=InnoDB;') AS sql_statements
FROM information_schema.tables AS tb
WHERE table_schema = @DATABASE_NAME
AND `ENGINE` = 'MyISAM'
AND `TABLE_TYPE` = 'BASE TABLE'
ORDER BY table_name DESC;
php -cli -q -d register_argc_argv=On artisan key:generate
import java.io.IOException;
import java.net.InetAddress;
import java.net.Socket;
import java.net.UnknownHostException;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSocket;
@erlangparasu
erlangparasu / aws-linux-2-wordpress.sh
Created March 11, 2019 18:20 — forked from skynet/aws-linux-2-wordpress.sh
Amazon Linux 2 LTS - Wordpress / PHP-FPM / NGINX / MariaDB / WP-CLI Auto Install
#!/bin/bash
##############################################################
# Set Your System and Wordpress Config Preferences
##############################################################
export SYSTEM_USER=username # User PHP-FPM runs under
# Database
export WP_DB_NAME=wordpress
[XDebug]
;; Only Zend OR (!) XDebug
zend_extension="C:\xampp\php\ext\php_xdebug-2.5.5-5.6-vc11.dll"
xdebug.remote_enable=On
xdebug.remote_host=127.0.0.1
xdebug.remote_port=10000
xdebug.remote_handler=dbgp
xdebug.profiler_enable=On
;; Windows OS: add environment variable:
@erlangparasu
erlangparasu / dev-tools.txt
Last active January 23, 2019 22:30
Development Tools
Mozilla Firefox
https://www.mozilla.org/en-US/firefox/
DBeaver - Universal Database Tool
https://dbeaver.io/
NetBeans
https://netbeans.apache.org/
Android Studio
pkexec chsh -s /bin/bash root