Skip to content

Instantly share code, notes, and snippets.

@ho3ein-mola
ho3ein-mola / cloudSettings
Last active August 14, 2019 13:10
vscode
{"lastUpload":"2019-08-14T13:10:02.608Z","extensionVersion":"v3.4.1"}
@ho3ein-mola
ho3ein-mola / AppServiceProvider.php
Created July 29, 2018 18:42
long string error in laravel
<?php
public function boot()
{
Schema::defaultStringLength(191);
}
@ho3ein-mola
ho3ein-mola / AppServiceProvider.php
Created July 29, 2018 18:42
long string error in laravel
<?php
public function boot()
{
Schema::defaultStringLength(191);
}
@ho3ein-mola
ho3ein-mola / UserController.php
Last active July 29, 2018 18:24
get user base on rule
<?php
$users = User::whereHas('roles', function ($query) {
$query->where('id', 2);
})->get();
import React from "react";
import { StatusBar } from "react-native";
import { Container, Button, text, ListItem, Text } from "native-base";
import Expo from "expo";
export default class App extends React.Component {
constructor(props) {
super(props);
this.state = { loading: true };
}
"scripts": {
"dev": "NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch": "NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"hot": "NODE_ENV=development webpack-dev-server --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
"production": "NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
}
sudo sh -c "echo 'deb http://download.opensuse.org/repositories/home:/osmc/xUbuntu_16.04/ /' > /etc/apt/sources.list.d/home:osmc.list"
sudo apt-get update
sudo apt-get install osmc-installer
@ho3ein-mola
ho3ein-mola / gist:b7aecaab51b7ce5688ee146c06536290
Created February 27, 2018 18:59 — forked from jstrosch/gist:3190568
iptables - delete all rules/chains
#view current chains
$ iptables -L
#remove/flush all rules & delete chains
$ iptables -F
$ iptables -X
$ iptables -t nat -F
$ iptables -t nat -X
$ iptables -t mangle -F
$ iptables -t mangle -X
@ho3ein-mola
ho3ein-mola / Virtual Box Host Only Static IP.md
Created February 24, 2018 20:21 — forked from pjdietz/Virtual Box Host Only Static IP.md
VirtualBox Host-Only Adapter with Static IP

VirtualBox Host-Only Static IP

My typical setup for a development box in VirtualBox uses two NICs. The first uses NAT to allow the box to communicate with the outside world through my host computer’s network connection. (NAT is the default, so shouldn't require any setup.) The second is a "host-only" connection that allows my host and guest to interact.

To create a host-only connection in VirtualBox, start by opening the preferences in VirtualBox. Go to the "Network" tab, and addd a Host-only Network. Modify the host-only network, and disable DHCP. Make a note of the IP address. (Feel free to set the IP address as well, if you like.)

Next, assign this host-only adapter to the virtual machine. Select the VM and press "Settings". Go to the "Network" tab, and select "Adpater 2". Enable the adapter, set it to a "Host-only Adapter", and select the adpater you created above.

Temporary

@ho3ein-mola
ho3ein-mola / 1-elementary-os-apps.md
Created February 24, 2018 01:36 — forked from ankurk91/1-elementary-os-apps.md
elementary OS 0.4.1 Loki

elementaryOS Apps and Configs

Enbale PPA support

sudo apt-get update
sudo apt-get -y install software-properties-common

Install original plank dock