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
@mahedi2014
mahedi2014 / google_map.php
Created April 30, 2016 05:22
Display location on google map from address using javascript google map api
<div id="map" style="width:70%;height:500px;"></div>
<h5>Tolarbag Mosque Road, Dhaka, Dhaka Division, Bangladesh</h5>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script>
var geocoder = new google.maps.Geocoder(); // initialize google map object
var address = "Tolarbag Mosque Road, Dhaka, Dhaka Division, Bangladesh";
geocoder.geocode( { 'address': address}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
@khoipro
khoipro / functions.php
Last active February 15, 2024 16:05
Remove Unnecessary Code in WordPress Header
// Remove Meta Generator: <meta name="generator" content="WordPress x.x" />
// and <meta name="generator" content="WooCommerce x.x.x" />
remove_action('wp_head', 'wp_generator');
// Remove the EditURI/RSD
// Like: <link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://localhost/wp/xmlrpc.php?rsd" />
remove_action ('wp_head', 'rsd_link');
// Remove it if you don't know what is Windows Live Writer
// <link rel="wlwmanifest" type="application/wlwmanifest+xml" href="http://localhost/wp/wp-includes/wlwmanifest.xml" />
@edisoncosta
edisoncosta / readme.md
Created March 27, 2016 17:54 — forked from rahul286/moved.md
woo-commerce fastcgi-cache session-conflict solution (attempt)

You can jump to code directly

How it works?

1. Cache product pages

Following line does't have /products.* page. This tells Nginx to cache all product pages by default.

Idea is fast loading product pages will improve scalability of a store and also conversion.

@lukas-h
lukas-h / license-badges.md
Last active April 20, 2025 12:09
Markdown License Badges for your Project

Markdown License badges

Collection of License badges for your Project's README file.
This list includes the most common open source and open data licenses.
Easily copy and paste the code under the badges into your Markdown files.

Notes

  • The badges do not fully replace the license informations for your projects, they are only emblems for the README, that the user can see the License at first glance.

Translations: (No guarantee that the translations are up-to-date)

@neilgee
neilgee / inline-css-wordpress.php
Last active February 15, 2023 18:41
WordPress how to pass Inline CSS to existing plugin or theme
<?php
//Adding CSS inline style to an existing CSS stylesheet
function wpb_add_inline_css() {
//All the user input CSS settings as set in the plugin settings
$slicknav_custom_css = "
@media screen and (max-width: {$ng_slicknav_width}px) {
{$ng_slicknav_menu} {
display: none;
@jonsuh
jonsuh / .bash_profile
Last active January 20, 2025 10:27
Bash echo in color
# ----------------------------------
# Colors
# ----------------------------------
NOCOLOR='\033[0m'
RED='\033[0;31m'
GREEN='\033[0;32m'
ORANGE='\033[0;33m'
BLUE='\033[0;34m'
PURPLE='\033[0;35m'
CYAN='\033[0;36m'
@corburn
corburn / CSP.md
Last active September 20, 2023 12:55 — forked from xrstf/letsencrypt.md
Nginx server notes

The following is from scotthelme.co.uk

Content Security Policy

with Content Security Policy (CSP) enabled(and a browser that supports it(http://caniuse.com/#feat=contentsecuritypolicy), you can tell the browser that it can only download content from the domains you explicitly allow http://www.html5rocks.com/en/tutorials/security/content-security-policy/ https://www.owasp.org/index.php/Content_Security_Policy I need to change our application code so we can increase security by disabling 'unsafe-inline' 'unsafe-eval'

@gbaman
gbaman / HowToOTG.md
Last active March 26, 2025 10:11
Simple guide for setting up OTG modes on the Raspberry Pi Zero

Raspberry Pi Zero OTG Mode

Simple guide for setting up OTG modes on the Raspberry Pi Zero - By Andrew Mulholland (gbaman).

The Raspberry Pi Zero (and model A and A+) support USB On The Go, given the processor is connected directly to the USB port, unlike on the B, B+ or Pi 2 B, which goes via a USB hub.
Because of this, if setup to, the Pi can act as a USB slave instead, providing virtual serial (a terminal), virtual ethernet, virtual mass storage device (pendrive) or even other virtual devices like HID, MIDI, or act as a virtual webcam!
It is important to note that, although the model A and A+ can support being a USB slave, they are missing the ID pin (is tied to ground internally) so are unable to dynamically switch between USB master/slave mode. As such, they default to USB master mode. There is no easy way to change this right now.
It is also important to note, that a USB to UART serial adapter is not needed for any of these guides, as may be documented elsewhere across the int

@prasetiyohadi
prasetiyohadi / nginx.conf
Created December 23, 2015 08:17
Mitigating DDOS Attack with Nginx
# Source: https://www.nginx.com/blog/mitigating-ddos-attacks-with-nginx-and-nginx-plus/
# DDOS characteristics:
# - traffic originates from a fixed set of IP addresses, much higher than requests from forward proxies
# - traffic is much higher than a human user can generate
# - The User-Agent header is sometimes set to a non-standard value
# - The Referer header is sometimes set to a value you can associate with the attack
# Limiting the rate of requests (example: 30 connection per minute per IP or allow request only every 2 seconds)
limit_req_zone $binary_remote_addr zone=one:10m rate=30r/m;
@bdwyertech
bdwyertech / nested.conf
Created December 10, 2015 22:46
Nginx - Nested locations and PHP-FPM
# => YOURLS URL Shortener Configuration
location /u/ {
root /var/www/api/urls/;
rewrite ^/(.*)/$ /$1/index.php last; # Enables index functionality (only really used for /u/admin/)
rewrite ^/u/(.*)$ /$1 break; # Strips /u/ from the URI for static files
try_files $uri /u/yourls-loader.php$is_args$args;
# => API PHP-FPM
location ~ \.php$ {
fastcgi_split_path_info ^/u(.+?\.php)(.*)$;