Skip to content

Instantly share code, notes, and snippets.

View jessuppi's full-sized avatar
❤️
let the bodies hit the floor

Jesse Nickles jessuppi

❤️
let the bodies hit the floor
View GitHub Profile
@saurabhalang
saurabhalang / MainActivity.java
Last active October 14, 2023 22:21
How to convert any Website into Android App in Android Studio?
// add this code to the onCreate method of your MainActivity.java File
String url ="URL" ; // Replace URL with your website address like this "http://google.com"
WebView view = (WebView) this.findViewById(R.id.webView);
view.getSettings().setJavaScriptEnabled(true);
view.loadUrl(url);
@ccurtin
ccurtin / Wordpress: redirect attachment pages to homepage url.php
Created July 2, 2015 17:55
Wordpress: redirect attachment pages to homepage url
<?php
/*
* Redirect Attachment Pages
*/
add_action( 'template_redirect', 'wpse27119_template_redirect' );
function wpse27119_template_redirect()
{
// Get out of here if not headed to an attachment page
if( ! is_attachment() ) return;
@v0lkan
v0lkan / nginx.conf
Last active December 2, 2025 18:08
Configuring NGINX for Maximum Throughput Under High Concurrency
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
@noodny
noodny / nginx.conf
Created June 8, 2015 05:28
Disable default server in nginx
server {
listen 80 default_server;
server_name _;
deny all;
}
@kasparsd
kasparsd / ms-cron-runner.php
Last active March 16, 2023 19:00
Cron for WordPress Multisite
<?php
// Author: Kaspars Dambis <[email protected]>
// Usage: php ms-cron-runner.php --domain=example.com [--path=/path/to/wordpress]
// We can't run this reliably from CLI because of how WordPress
// relies on $_SERVER for loading functions.php
if ( php_sapi_name() !== 'cli' )
die;
@kjbenk
kjbenk / purge_transients.php
Last active November 20, 2021 15:28
WordPress - Purge All Expired Transients
<?php
// Schedule the CRON Job to purge all expired transients
if (!wp_next_scheduled('purge_popup_transients_cron')) {
/**
* wp_schedule_event
*
* @param - When to start the CRON job
@zloynemec
zloynemec / adminer_setup.sh
Created April 15, 2015 12:29
Secure adminer nginx setup
# Secure adminer setup
# Author Taras Kozlov
# download adminer to separate directory
mkdir -p /var/www/admin
cd /var/www/admin
wget http://www.adminer.org/latest.php -O adminer.php
echo '<?php phpinfo(); >' > info.php
sudo -i
@geschke
geschke / redis-server.service
Last active January 10, 2021 20:11
WARNING. OUTDATED! The information on this page is severely out of date. Don't use it! Ubuntu systemd service file for Redis. The server was updated to a Ubuntu 15.04 (Vivid Vervet) distribution. Redis was installed from the PPA from Roman Wookey (https://launchpad.net/~rwky/+archive/ubuntu/redis). After the switch to systemd instead of Upstart,…
[Unit]
Description=Redis Datastore Server
After=network.target
[Service]
Type=forking
PIDFile=/var/run/redis/redis.pid
ExecStartPre=/bin/mkdir -p /var/run/redis
ExecStartPre=/bin/chown redis:redis /var/run/redis
@SpekkoRice
SpekkoRice / checkiftablexists
Created March 5, 2015 12:37
BASH: Check if MySQL Table exists
#!/bin/bash
checkIfMySQLTableExists() {
table=$1;
if [ $(mysql -N -s -u root -p -e \
"select count(*) from information_schema.tables where \
table_schema='${table}' and table_name='${DB}';") -eq 1 ]; then
echo "Table ${table} exists! ...";
else
echo "Table ${table} does not exist! ..."
@techgaun
techgaun / sysctl.conf
Created February 24, 2015 13:36
Sysctl configuration for high performance
### KERNEL TUNING ###
# Increase size of file handles and inode cache
fs.file-max = 2097152
# Do less swapping
vm.swappiness = 10
vm.dirty_ratio = 60
vm.dirty_background_ratio = 2