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
#!/usr/bin/env node | |
console.log("Hello") |
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
# remap prefix from 'C-b' to 'C-a' | |
unbind C-b | |
set-option -g prefix C-a | |
bind-key C-a send-prefix | |
# split panes using | and - | |
bind v split-window -h | |
bind s split-window -v | |
unbind '"' | |
unbind % |
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
<VirtualHost 127.0.0.1> | |
DocumentRoot "D:/Projects/EnFeed/user/user-dashboard/public" | |
ServerName user.enfeed.com | |
<Directory "D:/Projects/EnFeed/user/user-dashboard/public"> | |
Options FollowSymLinks Indexes ExecCGI | |
AllowOverride All | |
Order deny,allow | |
Allow from 127.0.0.1 | |
Deny from all | |
Require all granted |
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\Providers; | |
use Illuminate\Pagination\LengthAwarePaginator; | |
use Illuminate\Support\Collection; | |
use Illuminate\Support\Facades\Schema; | |
use Illuminate\Support\ServiceProvider; | |
class AppServiceProvider extends ServiceProvider |
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
namespace App\Traits; | |
trait SelfReferenceTrait | |
{ | |
protected $parentColumn = 'parent_id'; | |
public function parent() | |
{ | |
return $this->belongsTo(static::class); |
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
<img id="blah" alt="your image" width="100" height="100" /> | |
<input type="file" | |
onchange="document.getElementById('blah').src = window.URL.createObjectURL(this.files[0])"> |
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
# bash prompt | |
# get current branch in git repo | |
function parse_git_branch() { | |
BRANCH=`git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'` | |
if [ ! "${BRANCH}" == "" ] | |
then | |
STAT=`parse_git_dirty` | |
echo " [${BRANCH}${STAT}]" | |
else | |
echo "" |
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
#!/bin/sh | |
if [ -z "$1" ] | |
then | |
echo "No collection slug provided" | |
exit 1 | |
fi | |
coll_slug=$1 |
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
mongoexport --uri="" --collection=collection_name --out=collection_name.json | |
mongoimport --uri="" --collection=collection_name --file=collection_name.json | |
mongodump --uri="" --collection=collection_name | |
mongorestore --uri="" --db=db_name --collection=collection_name dump/db_name/collection_name | |
ref: https://hashinteractive.com/blog/mongodump-and-mongorestore-vs-mongoexport-and-mongoimport/ |
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
sudo -u www-data cmd | |
sudo -u ubuntu cmd | |
sudo -u server cmd | |
sudo -u user cmd |
OlderNewer