This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import ajax from 'superagent'; | |
class Detail extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
mode: 'commits', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Mon Jan 2 10:46:56 UTC 2017 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM php:5-cli | |
RUN apt-get update \ | |
&& apt-get install -y \ | |
git software-properties-common python-software-properties libicu-dev zlib1g-dev curl subversion bash \ | |
&& rm -rf /var/lib/apt/lists/* \ | |
&& docker-php-ext-configure zip \ | |
&& docker-php-ext-install zip \ | |
&& docker-php-ext-configure intl \ | |
&& docker-php-ext-install intl \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
# written by https://github.com/ducktype | |
# https://github.com/composer/composer/issues/1906#issuecomment-260348383 | |
error_reporting(E_ALL & ~E_NOTICE & ~E_USER_NOTICE & ~E_DEPRECATED & ~E_USER_DEPRECATED | |
& ~E_WARNING & ~E_CORE_WARNING & ~E_USER_WARNING & ~E_STRICT); | |
$composer_data = array( | |
'url' => 'https://getcomposer.org/composer.phar', | |
'dir' => __DIR__.'/.code', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SomeController extends Controller | |
{ | |
public function anydata(Request $request) | |
{ | |
$valid_columns = [ | |
'id', | |
'user_id', | |
'sh_name', | |
'sh_price', | |
'photo_id', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd /var/www/html # web root | |
mkdir temp_dir | |
cd temp_dir | |
wget https://files.phpmyadmin.net/phpMyAdmin/4.7.2/phpMyAdmin-4.7.2-english.tar.xz | |
tar xf phpMyAdmin-4.7.2-english.tar.xz | |
uuidgen # this will generate unique uuid copy_it | |
mv phpMyAdmin-4.7.2-english/ ../uniqe_uuid | |
cd .. | |
rm -rf temp_dir/ | |
cd uniqe_uuid/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// TODO create uploads/cache folder | |
public static function resize($path, $w, $h) | |
{ | |
$path = ltrim($path, '/'); | |
if (!file_exists(public_path($path))) { | |
$path = "uploads/placeholder.png"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Detect special conditions devices | |
$IOS = stripos($_SERVER['HTTP_USER_AGENT'],"iOS"); | |
//do something with this information | |
if( $IOS ){ | |
//browser reported as an iPhone/iPod touch -- do something here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function boot() | |
{ | |
Auth::viaRequest('multip-api', function ($request) { | |
$authorization = $request->header('Authorization'); | |
$role = $request->header('Auth-Role'); | |
if (!in_array($role, ['client', 'employee', 'admin', 'user'])) { | |
return null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Controllers; | |
class CityController extends BaseController | |
{ | |
public function getRegions() | |
{ | |
$s = request()->get('q', ''); |
OlderNewer