- იყავით თავაზიაები და პოზიტიურები მოდით, ყველას პატივისცემით მოვექცეთ. ჯანმრთელი დებატები ბუნებრივია, მაგრამ სიკეთე საჭიროა. ნუ იქნებით ის ტოქსიკური პიროვნება რომელისათვის ყველა და ყველაფერი არ ვარგა. აქ იმისთვის შევიკრიბეთ რომ, ერთმანეთი გავაუმჯობესოთ და არა დავამციროთ.
- Off Topic არ ჩამოშორდეთ მთვარ თემას.
- თუ გსურთ ლინკის ან ვიდეო მასალის ან რაიმე საინტერესო ინფორმაციის გაზიარება არ მოგერიდოთ, მთავარია თემატური და ინფორმაციული იყოს. სასურველია თუ მცირე განმარტებას გაუკეთებთ თუ რისთვის აშეარებთ ამა თუ იმ რესურს.
- თუ ვინმე არღვევს წესებს, ზრდილობიანად და თავაზიანად მიუთითეთ ამაზე.
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
function tinker() | |
{ | |
if [ -z "$1" ] | |
then | |
php artisan tinker | |
else | |
php artisan tinker --execute="dd($1);" | |
fi | |
} |
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
function StalinSort(array) { | |
if (!Array.isArray(array)) throw new TypeError('Argument must be an Array!'); | |
return array.reduce((prev, next) => | |
!prev.length || | |
next >= prev[prev.length - 1] ? | |
[...prev, next] : | |
prev | |
, []); | |
} |
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 | |
// Register collection macros in the boot method of a app service provider | |
// app/Providers/AppServiceProvider.php | |
// usage: collect([...])->get()->data_get('key.someData.0.email','Default') | |
Collection::macro('data_get', function ($key, $default = '') { | |
return $this->map(function ($value) use ($key, $default) { | |
return data_get($value, $key, $default); | |
}); | |
}); |
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 | |
$customers = collect([]); // some nested Laravel collection | |
// Instead of manually creating this monstrous nested loop... | |
$customers->each(function ($customer) { | |
$customer->orders->each(function ($order) { | |
$order->payments->each(function ($payment) { | |
//doWork($payment); | |
}); |
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
-- automatically fill Cisco AnyConnect credentials on mac | |
set targetApp to "Cisco AnyConnect Secure Mobility Client" | |
set vpnName to "yourVPNServer.com" | |
set pass to "YOURPASSWORD" | |
set loginWindowTitle to "Cisco AnyConnect | " & vpnName | |
tell application targetApp | |
activate | |
end tell | |
repeat until application targetApp is running |
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
-- Weigh rows against eachother based on different conditions, | |
-- ordering the results based on their given weights so that | |
-- more precise matches will show higher up in the results. | |
-- In this example, an exact match will show up at the top | |
-- of the results, a match at the beginning of the string | |
-- will show next, and a match anywhere will show last. | |
set @query = 'Liam'; |
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
#colorful prompt with git branch names | |
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' | |
} | |
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[01;31m\]$(parse_git_branch)\[\033[00m\]\$ ' |
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
# Ubuntu 15.04+ | |
[Unit] | |
Description=Setup a secure tunnel to server | |
Wants=network-online.target | |
After=network-online.target | |
[Service] | |
User=admin | |
Environment="LOCAL_ADDR=localhost" |
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 bash | |
# Basic info | |
IP=`hostname -I | awk '{print $1}'` | |
HOSTNAME=`uname -n` | |
#ROOT=`df -Ph | grep xvda1 | awk '{print $4}' | tr -d '\n'` | |
ROOT=`df -Ph | grep vda1 | awk 'NR==1{print $4}' | tr -d '\n'` | |
# System load | |
MEMORY1=`free -t -m | grep Total | awk '{print $3" MB";}'` |
NewerOlder