Skip to content

Instantly share code, notes, and snippets.

View abada's full-sized avatar

Abdulatif Henno abada

View GitHub Profile

"What Type Of Thing Are You" Quiz with jQuery

This is a basic template for one of those Buzzfeed-style personality quizzes, with flexible number of steps and results. Add, remove, or change possible results in the jQuery object 'resultOptions'. Layout is fluid responsive. There's a surprise at the end of the quiz! Created in Sass with jQuery by Jan Dennison @jannypie

Forked from jan dennison's Pen "What Type Of Thing Are You" Quiz with jQuery.

Forked from jan dennison's Pen "What Type Of Thing Are You" Quiz with jQuery.

A Pen by Lizzy Stellato on CodePen.

@abada
abada / background.js
Created February 13, 2021 09:31 — forked from danharper/background.js
Bare minimum Chrome extension to inject a JS file into the given page when you click on the browser action icon. The script then inserts a new div into the DOM.
// this is the background code...
// listen for our browerAction to be clicked
chrome.browserAction.onClicked.addListener(function (tab) {
// for the current tab, inject the "inject.js" file & execute it
chrome.tabs.executeScript(tab.ib, {
file: 'inject.js'
});
});
@abada
abada / gist:8d2502e3eb1b3206be7a77dab985c5af
Created February 29, 2020 13:38 — forked from nolim1t/gist:208993
Converting a binary file to base64 encoding
<?php
$file="/parh/to/binary";
$fp = fopen($file, "rb");
$binary = fread($fp, filesize($file));
echo base64_encode($binary);
?>
{
status: true,
data: [
"Adham",
"Aqiq",
"Baha",
"Biljurashi",
"Mandaq",
"Mukhwah",
"Namerah",
@abada
abada / cron
Created April 2, 2018 21:32
Starting the Laravel cron job on a Mac
accepted
Not directly answering your question, but proposing another solution:
If you want to set up cron jobs for your development environment, it's best to use Homestead, for its Linux standards compliance.
For small projects that i develop directly inside macOS, i run the following command inside the project root (in a separate terminal tab) to have my jobs run every minute:
```while true; do php artisan schedule:run; sleep 60; done```
@abada
abada / split.sh
Created February 12, 2018 09:00
split csv file
tail -n +2 file.txt | split -l 1000 - split_
for file in split_*
do
head -n 1 file.txt > tmp_file
cat $file >> tmp_file
mv -f tmp_file $file
done
@abada
abada / nginx.default.conf
Created January 14, 2018 21:32 — forked from santoshachari/nginx.default.conf
PHP5.6 and NGINX: Install PHP56-FPM, Nginx & MySQL on EC2 with Amazon Linux AMI
# Install linux update, followed by GCC and Make
sudo yum -y update
sudo yum install -y gcc make
# Install Nginx and php56-FPM
sudo yum install -y nginx php56-fpm
# Install php56 extensions
sudo yum install -y php56-devel php-mysql php56-pdo php56-pear php56-mbstring php56-cli php56-odbc php56-imap php56-gd php56-xml php56-soap
@abada
abada / mysql_dump_migration.php
Created December 28, 2017 10:20 — forked from scrubmx/mysql_dump_migration.php
Import mysql dump as laravel migration
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreatePostalCodesTable extends Migration {
/**
* Run the migrations.
*
@abada
abada / gist:13259ac5db54008d441ee778422610d7
Created November 19, 2017 07:49 — forked from kapkaev/gist:4619127
MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk. Commands that may modify the data set are disabled. Please check Redis logs for details about the error. Resque
$ redis-cli
> config set stop-writes-on-bgsave-error no
<?php
namespace App\Services;
use Validator;
use App\Models\Store;
use App\Models\User;
class UserService