Skip to content

Instantly share code, notes, and snippets.

View SumonMSelim's full-sized avatar
🎯
Focusing

Muhammad Sumon Molla Selim SumonMSelim

🎯
Focusing
View GitHub Profile
@RuGa
RuGa / massInsertOrUpdate.php
Last active April 12, 2024 16:54
Mass (bulk) insert or update on duplicate for Laravel 4/5
/**
* Mass (bulk) insert or update on duplicate for Laravel 4/5
*
* insertOrUpdate([
* ['id'=>1,'value'=>10],
* ['id'=>2,'value'=>60]
* ]);
*
*
* @param array $rows
@iolson
iolson / AuthenticateController.php
Last active December 4, 2022 23:24
SentinelAuthAdapter for using Tymon\JWTAuth with Cartalyst\Sentinel
<?php namespace App\Http\Controllers\Api\V1;
use App\Http\Controllers\Controller;
use App\Http\Requests;
use Illuminate\Http\Request;
use Tymon\JWTAuth\Facades\JWTAuth;
use Tymon\JWTAuth\Exceptions\JWTException;
class AuthenticateController extends Controller
{
@sohelamin
sohelamin / http-status-codes.php
Created April 23, 2015 09:05
HTTP Status Codes in a PHP Array
<?php
/**
* Codes collected from http://en.wikipedia.org/wiki/List_of_HTTP_status_codes
**/
$http_status_codes = array(
100 => 'Informational: Continue',
101 => 'Informational: Switching Protocols',
102 => 'Informational: Processing',
200 => 'Successful: OK',
@barryvdh
barryvdh / .phpstorm.meta.php
Last active October 20, 2021 22:16
Laravel PhpStorm Meta file
<?php
namespace PHPSTORM_META {
/**
* PhpStorm Meta file, to provide autocomplete information for PhpStorm
* Generated on 2017-09-28.
*
* @author Barry vd. Heuvel <barryvdh@gmail.com>
* @see https://github.com/barryvdh/laravel-ide-helper
*/
@prakhar1989
prakhar1989 / richhickey.md
Last active November 8, 2023 17:19 — forked from stijlist/gist:bb932fb93e22fe6260b2
richhickey.md

Rich Hickey on becoming a better developer

Rich Hickey • 3 years ago

Sorry, I have to disagree with the entire premise here.

A wide variety of experiences might lead to well-roundedness, but not to greatness, nor even goodness. By constantly switching from one thing to another you are always reaching above your comfort zone, yes, but doing so by resetting your skill and knowledge level to zero.

Mastery comes from a combination of at least several of the following:

from StringIO import StringIO
from openpyxl import Workbook
from openpyxl.compat import range
from openpyxl.cell import get_column_letter
from openpyxl.styles import Style, Font
def make_excel(dataset,
key_headers=None, # The order of attributes, or what to include
line_headers=None, # The order of table attributes, or what to include
@wdullaer
wdullaer / install.sh
Last active April 2, 2024 20:33
Install Latest Docker and Docker-compose on Ubuntu
# Ask for the user password
# Script only works if sudo caches the password for a few minutes
sudo true
# Install kernel extra's to enable docker aufs support
# sudo apt-get -y install linux-image-extra-$(uname -r)
# Add Docker PPA and install latest version
# sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
# sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
@koomai
koomai / PhpStorm Keyboard Shortcuts.md
Last active October 13, 2023 00:11
Frequently Used PhpStorm Keyboard Shortcuts

Note: Some of these shortcuts have been remapped for my own convenience (Preferences->Keymap). These are Mac shortcuts, just use the Windows/Linux equivalent of the Cmd/Option/Ctrl/Del keys.

####Search, Go to, Navigation ####

Cmd + P - Search file

Cmd + Shift + O - Search everywhere

(I swapped the above two recently because I use Cmd + P to search for files most of the time).

@suwardany
suwardany / platform-blog.md
Last active April 29, 2016 15:19
Setup a blog extension with Cartalyst Platform 2

Setup a blog extension with Cartalyst Platform 2

Download Platform

git clone https://github.com/cartalyst/platform.git blog

Install Dependencies

Navigate into the downloaded folder and run

/*
|--------------------------------------------------------------------------
| Delete form macro
|--------------------------------------------------------------------------
|
| This macro creates a form with only a submit button.
| We'll use it to generate forms that will post to a certain url with the DELETE method,
| following REST principles.
|
*/