This file contains hidden or 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 | |
| /* | |
| //Normal query | |
| User::all(); | |
| //Cached query (default 60min) | |
| User::cached()->all(); | |
| //Cached query (5min) |
This file contains hidden or 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
| <snippet> | |
| <content><![CDATA[ | |
| public function ${1:relationship}() | |
| { | |
| return \$this->belongsToMany(${1/^(.+)$/(?1\u$1:)/g}::class, {$2:table}); | |
| } | |
| ]]></content> | |
| <!-- Optional: Set a tabTrigger to define how to trigger the snippet --> | |
| <tabTrigger>belt</tabTrigger> | |
| <!-- Optional: Set a scope to limit where the snippet will trigger --> |
This file contains hidden or 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
| # Add postgresql repo and update apt listing | |
| echo "deb http://apt.postgresql.org/pub/repos/apt/ squeeze-pgdg main" > /etc/apt/sources.list.d/pgdg. | |
| wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - | |
| sudo apt-get update | |
| sudo apt-get upgrade | |
| # Stop all running postgresql servers -- needed for migration of 9.3 data to 9.4 (pg_upgrade execution) | |
| sudo /etc/init.d/postgresql stop | |
| # Must link conf file into data directory since it's expected there by pg_upgrade. |
This file contains hidden or 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\Console\Commands; | |
| use Illuminate\Console\Command; | |
| /** | |
| * Class SeedResource | |
| * @package App\Console\Commands\Resource | |
| */ |
This file contains hidden or 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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <dict> | |
| <key>ANSIBlackColor</key> | |
| <data> | |
| YnBsaXN0MDDUAQIDBAUGKSpYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS | |
| AAGGoKcHCBMXGyImVSRudWxs1QkKCwwNDg8QERJcTlNDb21wb25lbnRzVU5TUkdCXE5T | |
| Q29sb3JTcGFjZV8QEk5TQ3VzdG9tQ29sb3JTcGFjZVYkY2xhc3NPECgwLjAyNzQ1MTAw | |
| NjcgMC4yMTE3NjQ3MjMxIDAuMjU4ODIzNDg0MiAxTxAoMC4wMzkzODA3NDc4MiAwLjE2 |
This file contains hidden or 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 numpy as np | |
| import random | |
| class Node: | |
| def __init__(self,t,L,R,D,S,V,M,X): | |
| self.t=t | |
| self.L=L | |
| self.R=R | |
| self.D=D |
This file contains hidden or 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
| <!-- General Settings --> | |
| <advancedsettings> | |
| <loglevel hide="true">-1</loglevel> <!-- Comment: Disables logging --> | |
| <playcountminimumpercent>95</playcountminimumpercent> | |
| <skiploopfilter>0</skiploopfilter> <!-- Comment: For RPi or similar use 16 or higher (low CPU usage) --> | |
| <nodvdrom>true</nodvdrom> | |
| <!-- MySQL Library --> | |
| <videodatabase> | |
| <type>mysql</type> |
This file contains hidden or 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
| LATIN CAPITAL LETTER B WITH STROKE | |
| Unicode: U+0243 | |
| HTML: Ƀ | |
| LATIN SMALL LETTER B WITH STROKE | |
| Unicode: U+0180 | |
| HTML: ƀ |
This file contains hidden or 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 | |
| abstract class BaseRepository implements BaseRepositoryInterface | |
| { | |
| /** | |
| * The repository model | |
| * | |
| * @var \Illuminate\Database\Eloquent\Model | |
| */ | |
| protected $model; |
This file contains hidden or 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
| tell application "System Preferences" | |
| reveal pane "com.apple.preference.energysaver" | |
| end tell | |
| tell application "System Events" to tell process "System Preferences" to tell window "Energy Saver" | |
| set status to value of checkbox "Automatic graphics switching" of group 1 | |
| click checkbox "Automatic graphics switching" of group 1 | |
| end tell | |
| quit application "System Preferences" | |
| if status is 0 then | |
| return "Automatic switch activated" |