Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
I may be slow to respond.

Louay Akkad louy

💭
I may be slow to respond.
View GitHub Profile
@louy
louy / AccessibilityWrapper.tsx
Last active March 31, 2023 12:04
RN Accessibility Wrapper, a custom view that allows you to control the accessibility behaviour of a React Native component tree
View AccessibilityWrapper.tsx
/**
* @author Louay Alakkad (github.com/louy)
* @license MIT https://opensource.org/licenses/MIT
*/
import React from 'react'
import PropTypes from 'prop-types'
import {
NativeModules,
ViewProps,
ViewPropTypes,
@louy
louy / .htaccess
Created July 25, 2013 22:31
Apache .htaccess geographical redirect based on CloudFlare's geo-ip headers
View .htaccess
# add as many as you need...
SetEnvIf CF-IPCountry SY RedirectSubdomain=syria
SetEnvIf CF-IPCountry AE RedirectSubdomain=uae
SetEnvIf CF-IPCountry EG RedirectSubdomain=egypt
# Only redirect if Host is not a subdomain
SetEnvIfNoCase Host ^.+\.example\.com$ !RedirectSubdomain
# Only redirect if cookie "noredirect" doesn't exist
SetEnvIfNoCase ^Cookie$ noredirect=true !RedirectSubdomain
@louy
louy / nginx.conf
Created April 28, 2016 21:23
Docker Nginx Config
View nginx.conf
daemon off;
user nginx;
worker_processes 1;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
@louy
louy / replit-database-import-export.sh
Last active July 9, 2022 23:49
Replit database import/export
View replit-database-import-export.sh
# Export to a folder
mkdir -p db
cd db
curl -k $REPLIT_DB_URL?prefix= | xargs -I@ curl -k -O "$REPLIT_DB_URL/@"
cd ..
tar -czvf db.tar.gz db
# Then download db.tar.gz manually
@louy
louy / aws-mfa.sh
Last active August 19, 2019 13:39
aws-cli mfa session utility
View aws-mfa.sh
# AWS MFA session util
# Setup:
# assuming you're using a profile called "default":
# In ~/.aws/config, set up a default-mfa-temp profile:
# ```
# [default]
# region = eu-west-2
# [default-mfa-temp]
# region = eu-west-2
@louy
louy / is_email.js
Created July 8, 2013 10:47
is_email function from WordPress written in Javascript
View is_email.js
/**
* is_email function from WordPress
* written in Javascript
*
* by Louy Alakkad <me@l0uy.com>
*
* Verifies that an email is valid.
*
* Does not grok i18n domains. Not RFC compliant.
*
@louy
louy / index.html
Created December 18, 2018 19:51
React prototype boilerplate
View index.html
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>Prototype</title>
</head>
<body>
<div id="root"></div>
<script src="https://unpkg.com/react@16.7.0-alpha.2/umd/react.production.min.js"></script>
<script src="https://unpkg.com/react-dom@16.7.0-alpha.2/umd/react-dom.production.min.js"></script>
View keybase.md

Keybase proof

I hereby claim:

  • I am louy on github.
  • I am louay (https://keybase.io/louay) on keybase.
  • I have a public key ASBtmGtwrtSjxZxz-xcoWXvlt2aQt_RP7QT7QbdYobGkzwo

To claim this, I am signing this object:

View git-cleanup-branches
#!/bin/sh
set -e
git branch | grep -v "master" | xargs git branch -d
git fetch origin --prune
@louy
louy / FBDownloader.iim
Last active December 28, 2015 22:49
iMacros Facebook Album Downloader. All you need to do is open the album page and run this script in loop mode with loop max equal to the count of pictures inside the album.
View FBDownloader.iim
VERSION BUILD=8530828 RECORDER=FX
SET !ERRORIGNORE YES
TAB T=1
SET !LOOP 1
TAG POS={{!LOOP}} TYPE=A ATTR=CLASS:uiMediaThumb* EXTRACT=href
TAB OPEN
TAB T=2
URL GOTO={{!EXTRACT}}
SET !EXTRACT NULL