Skip to content

Instantly share code, notes, and snippets.

View BSN4's full-sized avatar
🎯
Focusing

Bader BSN4

🎯
Focusing
View GitHub Profile
error_page 497 https://$host:1234$request_uri;
#thanks to Mattias Geniar @ https://ma.ttias.be/force-redirect-http-https-custom-port-nginx/
@BSN4
BSN4 / FalconCollection.swift
Last active June 17, 2016 02:58
custom columns UICollectionView (swift edition)
//
// Cusutom UICollectionView Coulmns , You can resize rows size .. This code made for fun no bugs for now but use it carefully
// There're other methods to accomplish this but I prefier it this way
// Created by bader almutairi on 6/11/16.
// Copyright © 2016 phpfalcon. All rights reserved.
//
import Foundation
import UIKit
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>DVTConsoleDebuggerInputTextColor</key>
<string>0.908811 0.908811 0.908811 1</string>
<key>DVTConsoleDebuggerInputTextFont</key>
<string>Menlo-Bold - 11.0</string>
<key>DVTConsoleDebuggerOutputTextColor</key>
<string>0.851394 0.851394 0.851394 1</string>
@BSN4
BSN4 / index.js
Last active December 1, 2017 16:44
rtl fix react-native-swiper
/**
* react-native-swiper
* @author leecade<leecade@163.com>
* RTL patch by Bader Almutairi <@phpfalcon>
*/
import React, { Component, PropTypes } from 'react'
import {
Text,
View,
ScrollView,
@BSN4
BSN4 / ValetDriver.php
Last active July 21, 2017 11:43
fixing CROS bug
<?php
abstract class ValetDriver
{
/**
* Determine if the driver serves the request.
*
* @param string $sitePath
* @param string $siteName
* @param string $uri
@BSN4
BSN4 / PdfParser.php
Created September 18, 2018 20:37 — forked from smalot/PdfParser.php
Use this static class to extract Text from Pdf files. It supports compressed and uncompressed Pdf (version 1.1 to 1.7) : tested It supports octal encoded (eg : \050) content, but not hexadecimal (eg : <005E>). In some cases, it works better than "pdftotext" binary tool.
<?php
/**
* @file
* Class PdfParser
*
* @author : Sebastien MALOT <sebastien@malot.fr>
* @date : 2013-08-08
*
* References :
@BSN4
BSN4 / slugify.js
Created September 24, 2018 14:11 — forked from abdumu/slugify.js
Javascript function to generate a slug that `respect` Arabic.
function slugify(text) {
return text.toString().toLowerCase()
.replace(/\s+/g, '-')
.replace(/[^\w\u0600-\u06FF-]+/g, '')
.replace(/\-\-+/g, '-')
.replace(/^-+/, '').replace(/-+$/, '');
}
@BSN4
BSN4 / chain_helper.php
Created January 30, 2019 21:42 — forked from calebporzio/chain_helper.php
Handy "chain()" helper method for making non-fluent classes/objects fluent.
<?php
function chain($object)
{
return new class ($object) {
public function __construct($object)
{
$this->wrapped = $object;
}
@BSN4
BSN4 / moveredis
Created June 29, 2019 17:59
move redis keys from db to another
redis-cli keys '*' | xargs -I % redis-cli move % 3 > /dev/null
@BSN4
BSN4 / laravel_horizon.md
Created August 23, 2019 23:09 — forked from ankurk91/laravel_horizon.md
Laravel Horizon, redis-server, supervisord on Ubuntu server

Laravel Horizon, redis-server, supervisord on Ubuntu 16/18 server

Laravel 5.8, Horizon 3.x, Redis 5.x

Parepare application

  • Install and configure Laravel Horizon as instructed in docs
  • Make sure you can access the Horizon dashboard like - http://yourapp.com/horizon
  • For now it should show status as inactive on dashbaord

Install redis-server