Skip to content

Instantly share code, notes, and snippets.

View cybersholt's full-sized avatar
🏠
Working from home

Sean cybersholt

🏠
Working from home
View GitHub Profile
@webmasterkai
webmasterkai / img.l
Last active November 3, 2018 08:49 — forked from phpdude/nginx.conf
Mirror remote image files, supports dynamic resizing of images. nginx image_filter remote fetching with a local mirror of original and resized image. Using try_files instead of if statements and proxy_pass with proxy_store for permanent local storage. No cache expiration, that will need to be handled outside of this.
server {
server_name img.l;
root /var/www/cache/store/ns365;
index index.html;
# This requests the original file from itself and then resizes the image.
location ~ /resize/(\d+)x(\d+)/(.*) {
proxy_pass http://img.l/$3;
image_filter resize $1 $2;
image_filter_jpeg_quality 90;
@jniltinho
jniltinho / install_php71_centos.sh
Last active May 1, 2020 03:48
Install PHP 7.1 on CentOS 7.3
#!/bin/bash
### Install PHP 7.1 on CentOS 7.3 64Bits
### http://www.shaunfreeman.name/compiling-php-7-on-centos/
### https://www.howtoforge.com/tutorial/how-to-install-php-7-on-debian/
yum -y install git gcc gcc-c++ libxml2-devel pkgconfig openssl-devel bzip2-devel curl-devel libpng-devel libjpeg-devel
yum -y install libXpm-devel freetype-devel gmp-devel libmcrypt-devel mariadb-devel aspell-devel recode-devel libpqxx-devel
yum -y install autoconf bison re2c libicu-devel libwebp-devel wget unzip net-tools libc-client-devel libpng12-devel
yum -y install libxslt-devel
@eristoddle
eristoddle / phpcurl_fuck_your_cookiejar.php
Created January 31, 2014 19:12
PHP curl with cookies and no text files needed
<?php
function fetch($url, $cookies = null, $returnCookie = false) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
if($cookies){
curl_setopt($ch, CURLOPT_COOKIE, implode(';',$cookies));
}
curl_setopt($ch, CURLOPT_HEADER, 1);
@noogen
noogen / nginx-proxy.conf
Last active December 7, 2021 08:43
nginx proxy example
# https://www.scalescale.com/tips/nginx/nginx-proxy-cache-explained-2/
proxy_cache_path /var/lib/nginx/cache levels=1:2 keys_zone=my_diskcached:10m max_size=5g inactive=45m use_temp_path=off;
server {
listen 80;
set $cache_uri $uri;
server_name example.com;
location ~ /purge(/.*) {
proxy_cache_purge my_diskcached acme.mycachedefault$uri$is_args$args;
@metaylimpo
metaylimpo / functions.php
Last active February 2, 2022 15:39
Example of wordpress theme function file for several optimizations
/*
DO NOT COPY\PASTE. Take only what you need carefully.
The following code is just a few **examples** of optimizations that you can do in functions.php file.
*/
<?php
// disable google fonts
add_filter( 'elementor/frontend/print_google_fonts', '__return_false' );
@grisha87
grisha87 / purge.php
Last active July 27, 2022 12:16
PHP.Kryptik.AB removal script
<?php
/**
* PHP.Kryptik.AB Cleanup script
*
* Usage: place the script in same directory that contains files / directories
* to be scanned. Then run `php [script_name].php` and wait a bit
*
* @link http://blog.twelvecode.com
* @author Grzegorz Godlewski <grisha87@gmail.com>
@tdonohue
tdonohue / ConsoleZ-PowerShell-Git-for-Windows.md
Last active November 19, 2022 03:36
ConsoleZ + PowerShell + Posh-Git + Git for Windows (with SSH Agent Forwarding!)

Integrating ConsoleZ + Powershell + Git for Windows + posh-git (with SSH agent forwarding + Vagrant)

Tested on: Windows 10


This setup includes the following:

  • Using ConsoleZ for your terminal (This is optional. If you don't want it, skip anything having to do with ConsoleZ and just use PowerShell)
  • Running PowerShell behind the scenes
  • Installing Git for Windows + posh-git, to provide git commands (and ssh) to PowerShell
  • Auto-starting posh-git's SSH-Agent for SSH forwarding to remote servers, VMs, Vagrant, etc.
@dieppon
dieppon / currency_symbols.php
Last active February 13, 2023 15:46 — forked from gibbs/currency_symbols.php
An array of currency symbols as HTML entities
<?php
$currency_symbols = array(
'AED' => '&#1583;.&#1573;', // ?
'AFN' => '&#65;&#102;',
'ALL' => '&#76;&#101;&#107;',
'AMD' => '&#1380;',
'ANG' => '&#402;',
'AOA' => '&#75;&#122;', // ?
'ARS' => '&#36;',
'AUD' => '&#36;',
@prolic
prolic / rotate-screen.sh
Created February 22, 2015 16:23
Lenovo Yoga 3 Pro rotate script for linux
#!/bin/bash
# This script rotates the screen and touchscreen input 90 degrees each time it is called,
# also disables the touchpad, and enables the virtual keyboard accordingly
# by Ruben Barkow: https://gist.github.com/rubo77/daa262e0229f6e398766
#### configuration
# find your Touchscreen and Touchpad device with `xinput`
TouchscreenDevice='ATML1000:00 03EB:8A10'
TouchpadDevice='SYNA2B22:00 06CB:2714'
#!/bin/bash
# This script rotates the screen and touchscreen input 90 degrees each time it is called,
# also disables the touchpad, and enables the virtual keyboard accordingly
# by Ruben Barkow: https://gist.github.com/rubo77/daa262e0229f6e398766
#### configuration
# find your Touchscreen and Touchpad device with `xinput`
TouchscreenDevice='ATML1000:00 03EB:8C3C'
TouchpadDevice='SynPS/2 Synaptics TouchPad'