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
// We import the support for this helper | |
use Illuminate\Support\Str; | |
// We use the helper | |
echo($imagename) Str::uuid(); | |
// We get a random identifier | |
6e358c39-9663-4a1f-b911-4fd6baaa5b1c |
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
// Example of using the optional() helper | |
print optional($dessert->name)->category; |
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
WebSocket.connect('ws://demos.kaazing.com/echo'). | |
then((WebSocket webSocket) { | |
webSocket.listen(print, onError: print); | |
webSocket.add('hello'); | |
webSocket.add('world'); | |
webSocket.close(); | |
}).catchError(print); |
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 'package:meta/meta.dart'; | |
int sum(List<int> list, [int initial = 0]) { | |
var total = initial; | |
list.forEach((v) => total += v); | |
return total; | |
} | |
String joinToString(List<String> list, | |
{@required String separator, String prefix = ", String | |
suffix = "}) => | |
'$prefix${list.join(separator)}$suffix'; |
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
var list = [1, 2, 3]; | |
list.forEach((v) => print(v * 10)); |
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
struct SomeView: View { | |
var body: some View { | |
VStack { | |
List(1...10) { item in | |
Text("Item number \(item)") | |
} | |
.refreshable { | |
//enter code to execute during refresh here | |
} | |
} |
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
struct SomeView: View { | |
var body: some View { | |
List { | |
ForEach(1...10, id: \.self) { item in | |
Text("Item Number \(item)") | |
.swipeActions(edge: .leading) { | |
Button { | |
//enter button actions here | |
} label: { | |
Text("Action Here") |
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
struct Cars: Identifiable { | |
var id = UUID() | |
var name: String | |
} | |
struct SomeView: View { | |
@State var searchText: String = "" | |
@State var cars: [Cars] = [Cars(name: "Nissan"), Cars(name: "Mercedes"), Cars(name: "BMW")] | |
var body: some View { | |
NavigationView { | |
List($cars) { $car in |
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
define( 'WP_POST_REVISIONS', false ); |
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
define( 'WP_POST_REVISIONS', 3 ); |