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
"abi": [ | |
{ | |
"inputs": [ | |
{ | |
"internalType": "contract ANTv2MultiMinter", | |
"name": "_minter", | |
"type": "address" | |
}, | |
{ |
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
// you can use includes, for example: | |
// #include <algorithm> | |
// you can write to stdout for debugging purposes, e.g. | |
// cout << "this is a debug message" << endl; | |
struct Point | |
{ | |
Point(char tag, int x, int y) | |
:m_tag(tag) | |
,m_dist(long(x)*long(x) + long(y)*long(y)) |
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
CASE 2: Not First Page Load | |
SSR: After clicking on a link to move to another page, the browser has to make a request to the server, | |
which would have to do everything (async calls, creating html, putting data in it) and then returning it. | |
Operations = html request + async call + creating html + putting data into html | |
note 1: async call happens from a server, that should be super fast. | |
note 2: creating html + putting data into html happens on a server, so that should be super fast. |
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
<div class="row"> | |
<div class="child"> | |
</div> | |
</div> |
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
FB.init({ | |
appId: process.env.FACEBOOK_ID, | |
version: "v3.3", | |
status: true, | |
cookie: true | |
}); | |
let share = { | |
method: "feed", |
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
function solution($S, $K) { | |
// write your code in PHP7.0 | |
print "$S, $K<br>\n"; | |
$min = ""; | |
for($i=0; $i<=strlen($S)-$K-1; $i++) { | |
$n = $i+$K; | |
$string = substr($S,0,$i).substr($S,$n); | |
//print "new string $i $string\n"; | |
$notation = notation($string); | |
$len = strlen($notation); |
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
self.addEventListener('pushsubscriptionchange', function(event) { | |
event.waitUntil( | |
fetch('https://pushpad.xyz/pushsubscriptionchange', { | |
method: 'POST', | |
headers: { 'Content-Type': 'application/json' }, | |
body: JSON.stringify({ | |
old_endpoint: event.oldSubscription ? event.oldSubscription.endpoint : null, | |
new_endpoint: event.newSubscription ? event.newSubscription.endpoint : null, | |
new_p256dh: event.newSubscription ? event.newSubscription.toJSON().keys.p256dh : null, | |
new_auth: event.newSubscription ? event.newSubscription.toJSON().keys.auth : null |
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
function askPermission() { | |
return new Promise(function(resolve, reject) { | |
const permissionResult = Notification.requestPermission(function(result) { | |
resolve(result); | |
}); | |
if (permissionResult) { | |
permissionResult.then(resolve, reject); | |
} |
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
class TestPlugin { | |
apply(compiler) { | |
compiler.hooks.afterEmit.tap('TestPlugin', (compilation) => { | |
let options = {}; // some options i will put here | |
let plugin = new SomePlugin(); // this will be webpack's plugin, not mine | |
compiler.apply(plugin); | |
}) | |
} | |
} |
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
$vehicle = App\Http\Models\Vehicle::findOrFail(2); | |
return $vehicle->with([ | |
'latestPrice' => function($query) { | |
$query->where('milleage', 1000)->latest('id'); | |
}, | |
'latestDamage' => function($query){ | |
$query->where('user_id', 1)->latest(); | |
}, | |
'latestDamage.images' | |
])->first(); |