Skip to content

Instantly share code, notes, and snippets.

View miftahafina's full-sized avatar
🏠
Work from heaven

Miftah Afina miftahafina

🏠
Work from heaven
View GitHub Profile
@LeCoupa
LeCoupa / redis_cheatsheet.bash
Last active March 18, 2024 09:08
Redis Cheatsheet - Basic Commands You Must Know --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
# 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.
@hanhpv
hanhpv / nginx-phpfpm-mysql-on-mac.md
Last active April 3, 2024 08:59
Nginx, PHP-FPM, MySQL on Mac OSX

Xcode

Make sure you have the latest version of XCode installed. Available from the AppStore.

Install the Xcode Command Line Tools:

xcode-select --install

Homebrew

Homebrew is the missing package manager for OSX. Download and install using the following command:

@parmentf
parmentf / GitCommitEmoji.md
Last active April 23, 2024 10:28
Git Commit message Emoji
@psgganesh
psgganesh / default
Last active September 13, 2022 03:24
Simple lumen nginx conf
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
listen 443 ssl;
root /var/www/lumen/public;
index index.php index.html index.htm;
server_name server_domain_or_IP;
@stevekinney
stevekinney / front-end-curriculum.md
Created August 9, 2015 00:47
Front-end Curriculum Draft

Module 1

  • Semantic markup
  • HTML standards mode and quirks mode
  • HTML fundamentals
    • Classes and IDs
  • CSS fundamentals
    • Selectors
    • Resets and normalizers
    • The box model
<?php
require 'vendor/autoload.php';
//require 'SplClassLoader.php';
//$classLoader = new SplClassLoader();
//$classLoader->register();
// Must manually include these :(
@kadimi
kadimi / arabic_numerals.php
Last active December 26, 2021 08:13
Convert numbers in Arabic
<?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 March 26, 2014 18:22
A title-case filter for AngularJs
// 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 February 8, 2022 03:13
Laravel 4 Eloquent Cheat Sheet.

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 February 15, 2013 21:16
Create and Edit Database Schema's with Laravel's new Illuminate libraries.
<?php
require 'vendor/autoload.php';
//require 'SplClassLoader.php';
//$classLoader = new SplClassLoader();
//$classLoader->register();
// Must manually include these :(