Skip to content

Instantly share code, notes, and snippets.

View vimalmistry's full-sized avatar
🎯
Focusing

Vimal Mistry vimalmistry

🎯
Focusing
View GitHub Profile
@vimalmistry
vimalmistry / HandlePutFormData.php
Created April 19, 2021 10:37 — forked from JhonatanRaul/HandlePutFormData.php
Laravel: Middleware to support multipart/form-data in PUT, PATH and DELETE requests. Deals with one level of form arrays.
<?php
namespace App\Http\Middleware;
use Closure;
use Symfony\Component\HttpFoundation\ParameterBag;
use Illuminate\Support\Arr;
/**
* @author https://github.com/Stunext
import 'package:flutter/material.dart';
import 'package:flutter_mobx/flutter_mobx.dart';
import '../core/models/conversation_model.dart';
import '../core/models/user_model.dart';
class UserBar extends StatelessWidget implements PreferredSizeWidget {
final Conversation conversation;
//
UserBar(this.conversation);
@vimalmistry
vimalmistry / terminal-colors-branch
Created August 22, 2018 09:34 — forked from danielalvarenga/terminal-colors-branch.sh
Show branch in terminal Ubuntu
# Add in ~/.bashrc or ~/.bash_profile
function parse_git_branch () {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
RED="\[\033[01;31m\]"
YELLOW="\[\033[01;33m\]"
GREEN="\[\033[01;32m\]"
BLUE="\[\033[01;34m\]"
NO_COLOR="\[\033[00m\]"
@vimalmistry
vimalmistry / howto.md
Created August 19, 2018 22:50 — forked from leomelzer/howto.md
Installing ImageMagick & Ghostscript on Ubuntu
  1. You have Ghostscript installed, right? Otherwise sudo apt-get install ghostscript
  2. This is important and installs the headers (iapi.h etc) which are required but don't come with the default Ghostscript package: sudo apt-get install libgs-dev
  3. I also needed sudo apt-get install gs-esp
  4. For me the pre compiled version of ImageMagick never accepted Ghostscript, so let's remove it: sudo apt-get --purge remove imagemagick
  5. Get the source of ImageMagick, untar it, cd ImageMagick-xx
  6. ./configure --with-gslib=yes [and what else you need]
  7. Confirm in the output near the bottom gslib yes yes and not gslib yes no
  8. make
  9. make install
  10. Run convert -list configure | grep DELEGATES => DELEGATES bzlib djvu freetype gs jpeg jng jp2 lcms png tiff x11 xml zlib
@vimalmistry
vimalmistry / readme.md
Created January 12, 2018 17:48 — forked from rheajt/readme.md
sass setup for create-react-app cli tool

Create-React-App with Sass configuration

Here are instructions for add Sass support to an app built with create-react-app. Hopefully this will be redundant when Sass support is built into the tool! Visit their form and let them know you need Sass support.

Install the create-react-app tool from npm. This will be installed globally. We also need to install the loaders needed for webpack, and we will save those as development dependencies.

npm install -g create-react-app

create-react-app your-app-name
cd your-app-name
<?php
public function fileUploadAndResize(Request $request, $user)
{
ini_set('memory_limit', '256M');
if ($request->file('image')) {
$image = $request->file('image');
$filename = uniqid($user->id) . '.' . $image->getClientOriginalExtension();
CREATE TABLE `user` (
`twitter_id` int(10) unsigned NOT NULL,
`name` varchar(140) NOT NULL,
`screen_name` varchar(30) NOT NULL,
`location` varchar(180) default NULL,
`description` varchar(300) default NULL,
`profile_image_url` varchar(400) NOT NULL,
`url` varchar(400) default NULL,
`protected` varchar(5) default NULL,
`followers_count` int(10) unsigned NOT NULL,
@vimalmistry
vimalmistry / template.php
Created June 3, 2016 20:19 — forked from nambok/template.php
Template class
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
Class Template{
/*
* variables
*/
/**