Skip to content

Instantly share code, notes, and snippets.

View Adrian0350's full-sized avatar
🔍
Working

Jaime Zúñiga Adrian0350

🔍
Working
View GitHub Profile
@endolith
endolith / Has weird right-to-left characters.txt
Last active July 17, 2024 12:41
Unicode kaomoji smileys emoticons emoji
ּ_בּ
בּ_בּ
טּ_טּ
כּ‗כּ
לּ_לּ
מּ_מּ
סּ_סּ
תּ_תּ
٩(×̯×)۶
٩(̾●̮̮̃̾•̃̾)۶
@kamermans
kamermans / fail2ban-allstatus.sh
Created July 11, 2011 17:06
Show status of all fail2ban jails at once
#!/bin/bash
JAILS=`fail2ban-client status | grep "Jail list" | sed -E 's/^[^:]+:[ \t]+//' | sed 's/,//g'`
for JAIL in $JAILS
do
fail2ban-client status $JAIL
done
@pasela
pasela / cakephp2.conf
Created July 5, 2012 09:37
nginx configuration example for CakePHP 2.x
#
# nginx configuration example for CakePHP 2.x
#
server {
listen 80;
server_name cakephp2.example;
root /var/www/cakephp2/app/webroot;
access_log /var/log/nginx/cakephp2.access.log;
error_log /var/log/nginx/cakephp2.error.log;
@jeromegamez
jeromegamez / array_keys_exist.php
Last active May 9, 2017 18:41
PHP: array_keys_exist() - like`array_key_exist(), but for multiple keys
<?php
/**
* Returns TRUE if the given keys are all set in the array. Each key can be any value possible for an array index.
*
* @see array_key_exists()
*
* @param array $array An array with keys to check.
* @param string[] $keys Keys to check.
* @param mixed $missing Reference to a variable that that contains the missing keys.
@dakeshi
dakeshi / WKWebView_tel_sms_mailto_tags_and_appstore_connection.swift
Last active June 20, 2022 00:47
Detect tel, sms, mailto tags in WKWebView
func webView(webView: WKWebView, decidePolicyForNavigationAction navigationAction: WKNavigationAction, decisionHandler: (WKNavigationActionPolicy) -> Void) {
let url = navigationAction.request.URL?.absoluteString
let hostAddress = navigationAction.request.URL?.host
// To connnect app store
if hostAddress == "itunes.apple.com" {
if UIApplication.sharedApplication().canOpenURL(navigationAction.request.URL!) {
@ImpactSeo
ImpactSeo / encoding.php
Created June 22, 2016 12:12
Clean UTF-8
<?php
/**
* Main function to call before sending your text through API
*/
function clean_utf8($text)
{
$encoding = mb_detect_encoding($text, 'UTF-8, ISO-8859-1');
if($encoding==='UTF-8')
@carlosascari
carlosascari / AcrosticRegistration.md
Last active September 12, 2016 17:04
Acrostic Registration - Registering new users with poetry

Acrostic Registration

Registering new users with poetry

An acrostic is a poem (or other form of writing) in which the first letter (or syllable, or word) of each line (or paragraph, or other recurring feature in the text) spells out a word, message or the alphabet.... As a form of constrained writing, an acrostic can be used as a mnemonic device to aid memory retrieval.

A Person chooses a username; ascari for example.

The number of letters will be the number of lines in the poem, beginning each with a letter from the username chosen.

and behold! the

Assuming you are using the official PHP Docker image...

# ---------------------------------------------------------------
# PHP Extension: Gearman
# Download Gearman PECL extension for Gearman supporting PHP 7
RUN apt-get -y --allow-unauthenticated install \
    libgearman-dev
RUN cd /tmp \
 &amp;&amp; git clone https://github.com/wcgallego/pecl-gearman.git \
@nicks9188
nicks9188 / LC_CTYPE.md
Created May 6, 2019 13:51
Centos warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory
  1. vi /etc/environment

add these lines...

LANG=en_US.utf-8
LC_ALL=en_US.utf-8

Alternatively,

@o5
o5 / dump.sh
Last active May 23, 2024 20:09
MySQL / MariaDB Dump Helper
#!/usr/bin/env bash
# MySQL / MariaDB Dump Helper
# ===========================
# FEATURES: Progress bar with ETA, support multiple databases (dump into separated files) and password as argument
# REQUIREMENTS:
# =============
# GNU Core Utilities, mysql, mysqldump, pv (https://github.com/icetee/pv)