public class Hello
{
public static void Main()
{
- System.Console.WriteLine("Hello, World!");
+ System.Console.WriteLine("Rock all night long!");
}
}
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
.custom(value => { | |
const post = JSON.parse(value); | |
if (!post || post.type !== 'doc' || | |
!Array.isArray(post.content) || post.content.length === 0 | |
) { | |
return Promise.reject(errors.jsonHTML) | |
} | |
const [item] = post.content; |
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 Vue from 'vue' | |
import * as types from './mutation-types' | |
export default { | |
// Mutation to set entries in state | |
[types.SET_ENTRIES] (state, entries) { | |
state.entries = entries || {} | |
}, | |
// Mutation to add entry in state |
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 | |
if (Voyager::translatable($items)) { | |
$items = $items->load('translations'); | |
} | |
@endphp | |
<ul class="navbar-nav ml-auto"> | |
@foreach($items as $item) |
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
$app->mailer = function () { | |
$transport = Swift_SmtpTransport::newInstance('smtp.gmail.com', '465', 'ssl') | |
->setUsername('[email protected]') | |
->setPassword('password'); | |
$mailer = Swift_Mailer::newInstance($transport); | |
return $mailer; | |
}; |
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 | |
class ArticlesController extends Controller { | |
public function show() | |
{ | |
$count = Article::count(); | |
if($count < [?]) { | |
// return the normal http view. | |
// the datatable will handle the dirty work. |
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 Illuminate\Foundation\Auth; | |
use Illuminate\Http\Request; | |
use Illuminate\Support\Facades\Auth; | |
trait AuthenticatesUsers | |
{ | |
use RedirectsUsers, ThrottlesLogins; |
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 | |
/** | |
* Show the form for creating a new resource. | |
* | |
* @return \Illuminate\Http\Response | |
*/ | |
public function create() | |
{ | |
$tags = Tag::select('name', 'id')->get(); // <------- This is very !important | |
return view('posts.create')->withTags($tags); |
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 DisableErrorGlowOnFocus() { | |
$("input:not([type=submit]):not([type=button]):not([type=radio]):not([type=checkbox]):not([type=file]).disableonfocus").on('focus', function() { | |
$(this).removeClass("formjs-error"); | |
$(this).removeClass("disableonfocus"); | |
}); | |
$("textarea.disableonfocus").on('focus', function() { | |
$(this).removeClass("formjs-error"); | |
$(this).removeClass("disableonfocus"); | |
}); | |
} |
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 | |
class Helper | |
{ | |
public static function get( $arr, $key, $default=null ) | |
{ | |
@list( $index, $key ) = explode( '.', $key, 2 ); | |
if ( !isset( $arr[$index] ) ) return $default; |