Skip to content

Instantly share code, notes, and snippets.

View breda's full-sized avatar

B. Reda breda

View GitHub Profile
@breda
breda / gulpfile.js
Last active August 29, 2015 14:13
Gulp SASS Watcher Tasks With Theme Support
/*
* This is a simple Gulp SASS Watcher task, that support themes... yeah!
* Usage: gulp watch:scss --theme dark-theme OR gulp watch:scss -t my-flat-theme ('base' is the default theme name)
* But dark-theme config (assets source dir which is a glob string, and destination dir) must be set in the config variable
* It's basically just a simple way, to make changing assets directories more dynamic!
* Just change the theme's config variables, and update the theme name within the command, and you're all set!
* Very Important Note! :
* ** What to do with the theme's source assets (scss files and such) is totally up to you... just lettin' you know.
*/
@breda
breda / FormBuilder.php
Created February 3, 2015 15:04
Laravel FormBuilder - Adding attributes to option tags is supported
<?php namespace Illuminate\Html;
use Illuminate\Routing\UrlGenerator;
use Illuminate\Session\Store as Session;
use Illuminate\Support\Traits\MacroableTrait;
class FormBuilder {
use MacroableTrait;
@breda
breda / Person.java
Created February 19, 2016 14:08
Builder Example
public class Person {
/* Attributes */
protected String name;
protected String email;
protected int age;
protected String adress;
protected String job;
protected boolean married;
@breda
breda / countries.html
Last active September 28, 2022 05:19
HTML Country List Dropdown - In Arabic
<select name="country">
<option value="" disabled selected>إختر</option>
<option value="أفغانستان">أفغانستان</option>
<option value="ألبانيا">ألبانيا</option>
<option value="الجزائر">الجزائر</option>
<option value="أندورا">أندورا</option>
<option value="أنغولا">أنغولا</option>
<option value="أنتيغوا وباربودا">أنتيغوا وباربودا</option>
<option value="الأرجنتين">الأرجنتين</option>
<option value="أرمينيا">أرمينيا</option>
<?php
use Illuminate\Http\Request;
use Illuminate\Cookie\CookieJar;
class CookieManager {
/*
* Get Cookie by name.
*/
<!DOCTYPE html>
<html>
<head>
<title> OpenStreenMap </title>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.5.1/leaflet.css">
<script type='text/javascript' src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js'></script>
<script type='text/javascript' src='https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.5.1/leaflet.js'></script>
</head>
<body>
@breda
breda / tasks.yml
Created January 13, 2022 13:12
Ansible: Create a self signed certificate (for nginx usage or other).
- name: "SSL Self-Sign: Generate RSA Key"
openssl_privatekey: path="/etc/nginx/ssl/{{ ssl_certificate_key }}" size=4096
become: yes
become_user: root
notify: reload-nginx
tags: ssl
- name: "SSL Self-Sign: Generate Certificate Signing Request"
openssl_csr:
path: "/etc/nginx/ssl/ssl.csr"