Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Miftah Afina miftahafina

🎯
Focusing
Block or report user

Report or block miftahafina

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View LEMP Laravel 5.5 on EC2.md

AWS EC2, Ubuntu 16.04, PHP 7.1, NGINX, Laravel 5.5, MariaDB 10.2, Composer

DISCLAIMER: I will avoid using generic keywords so that you're forced to name things yourself:

test, example, default, key, 10.174.75.99

latvija, pupper, elvisoctp, ilunimati-top-security, 10.10.10.1000000000
@LeCoupa
LeCoupa / redis_cheatsheet.bash
Last active Nov 18, 2019
Redis Cheatsheet - Basic Commands You Must Know --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
View redis_cheatsheet.bash
# Redis Cheatsheet
# All the commands you need to know
redis-server /path/redis.conf # start redis with the related configuration file
redis-cli # opens a redis prompt
# Strings.
View front-end-curriculum.md

Module 1

  • Semantic markup
  • HTML standards mode and quirks mode
  • HTML fundamentals
    • Classes and IDs
  • CSS fundamentals
    • Selectors
    • Resets and normalizers
    • The box model
View laravel_schema.php
<?php
require 'vendor/autoload.php';
//require 'SplClassLoader.php';
//$classLoader = new SplClassLoader();
//$classLoader->register();
// Must manually include these :(
@kadimi
kadimi / arabic_numerals.php
Last active Nov 14, 2019
Convert numbers in Arabic
View arabic_numerals.php
<?php
/**
* Converts numbers in string from western to eastern Arabic numerals.
*
* @param string $str Arbitrary text
* @return string Text with western Arabic numerals converted into eastern Arabic numerals.
*/
function arabic_w2e($str) {
$arabic_eastern = array('٠', '١', '٢', '٣', '٤', '٥', '٦', '٧', '٨', '٩');
@jeffjohnson9046
jeffjohnson9046 / title-case-filter.js
Created Mar 26, 2014
A title-case filter for AngularJs
View title-case-filter.js
// Came from the comments here: https://gist.github.com/maruf-nc/5625869
app.filter('titlecase', function() {
return function (input) {
var smallWords = /^(a|an|and|as|at|but|by|en|for|if|in|nor|of|on|or|per|the|to|vs?\.?|via)$/i;
input = input.toLowerCase();
return input.replace(/[A-Za-z0-9\u00C0-\u00FF]+[^\s-]*/g, function(match, index, title) {
if (index > 0 && index + match.length !== title.length &&
match.search(smallWords) > -1 && title.charAt(index - 2) !== ":" &&
(title.charAt(index + match.length) !== '-' || title.charAt(index - 1) === '-') &&
@msurguy
msurguy / eloquent.md
Last active Feb 13, 2019
Laravel 4 Eloquent Cheat Sheet.
View eloquent.md

Conventions:

Defining Eloquent model (will assume that DB table named is set as plural of class name and primary key named "id"):

class Shop extends Eloquent {}

Using custom table name

protected $table = 'my_shops';

@Xeoncross
Xeoncross / laravel_schema.php
Created Feb 15, 2013
Create and Edit Database Schema's with Laravel's new Illuminate libraries.
View laravel_schema.php
<?php
require 'vendor/autoload.php';
//require 'SplClassLoader.php';
//$classLoader = new SplClassLoader();
//$classLoader->register();
// Must manually include these :(
@sineld
sineld / optgroup.php
Created Oct 2, 2012
Laravel: Using form::select with <optgroup>
View optgroup.php
<?php
//Source: http://forums.laravel.com/viewtopic.php?id=2807
Route::get('optgroup', function()
{
$eat_options = array(
'animals' => array(
'cats',
'dogs',
'monkeys',
@DanielMarklund
DanielMarklund / gist:3415529
Created Aug 21, 2012
Laravel - Navigation Active Class
View gist:3415529
<!-- Example on how to set class="active" on active navigation links -->
<!-- These links will always be visible -->
<li class="{{ URI::is( 'home') ? 'active' : '' }}">
<a href="{{ URL::to( 'home') }}">
Home
</a>
</li>
<li class="{{ URI::is( 'gallery') ? 'active' : '' }}">
You can’t perform that action at this time.