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
@lou
lou / gmap-fullscreen.js
Created January 2, 2012 12:10
Google map Fullscreen with jQuery
$(function() {
var map = new google.maps.Map(document.getElementById("map_canvas"), {});
var newyork = new google.maps.LatLng(40.69847032728747, -73.9514422416687);
var googleMapWidth = $("#map_canvas").css('width');
var googleMapHeight = $("#map_canvas").css('height');
map.setCenter(newyork);
$('#enter-full-screen').click(function(){
from jira import JIRA
import pandas as pd
import pdb
from collections import defaultdict
import datetime
import pprint
class ImportJiraAnalyticsData:
@choyan
choyan / gist:6884351
Created October 8, 2013 13:04
Hibernate on ElementaryOS
To do so on terminal:
gksu gedit /etc/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla
Replace gedit with your favorite editor’s command. This command will open a blank file. Copy and paste these lines:
[Enable Hibernate]
Identity=unix-user:*
Action=org.freedesktop.upower.hibernate
ResultActive=yes
@marufmax
marufmax / App\Exceptions\Handler.php
Last active December 17, 2018 10:15
Laravel/Lumen API Error Handleing
<?php
/**
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
* @param \Exception $exception
* @return \Illuminate\Http\Response
*/
public function render($request, Exception $exception)
{
@theanam
theanam / logger.js
Created April 5, 2019 17:53
Stdout logs on Steroids
const moment = require('moment');
const colors = {
"green" :"\x1b[32m",
"yellow":"\x1b[33m%s\x1b[0m",
"red":"\x1b[31m",
"cyan":"\x1b[36m",
"blue":"\x1b[34m",
"default":""
}
module.exports = function (message,color="default"){
@ralphschindler
ralphschindler / SnapshotCommand.php
Created July 11, 2019 20:26
An example Laravel app command to create and load database snapshots using S3
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Storage;
class SnapshotCommand extends Command
{
@JeffreyWay
JeffreyWay / routes.php
Last active August 18, 2019 00:06
This route will require authentication with a valid api_token, and then return the relevant user, as JSON. - https://laracasts.com/series/whats-new-in-laravel-5-2/episodes/5
<?php
Route::group([
'prefix' => 'api/v1',
'middleware' => ['api', 'auth:api']
], function () {
Route::get('/', function () {
return Auth::guard('api')->user();
});
@imasif
imasif / exportDB.sh
Last active June 22, 2020 13:57
Export mongodb database into JSON files, and import the JSON again.
#!/bin/bash
if [ ! $1 ]; then
echo " Example of use: $0 database_name dir_to_store"
exit 1
fi
db=$1
out_dir=$2
if [ ! $out_dir ]; then
out_dir="./"
@adamwathan
adamwathan / belongs-to-many.sublime-snippet
Last active October 19, 2020 16:59
Eloquent Relationship snippets for Sublime Text
<snippet>
<content><![CDATA[
public function ${1:relationship}()
{
return \$this->belongsToMany(${1/^(.+)$/(?1\u$1:)/g}::class, {$2:table});
}
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>belt</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
@zabaala
zabaala / BindDatabaseServiceProvider.php
Last active March 2, 2021 07:50
php artisan db:log <start> <stop>
<?php
namespace App\Commands\Database;
use Illuminate\Support\ServiceProvider;
class BindDatabaseServiceProvider extends ServiceProvider
{
public function boot()
{