Discover gists
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
// worker pool graceful shutdown with waitGroup and context | |
func main() { | |
// create a channel to capture SIGTERM, SIGINT signal | |
quit := make(chan os.Signal, 1) | |
signal.Notify(quit, syscall.SIGTERM, syscall.SIGINT) | |
var wg sync.WaitGroup | |
pool := make(chan int, 10) | |
id := 1 |
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
;SMBDIS.ASM - A COMPREHENSIVE SUPER MARIO BROS. DISASSEMBLY | |
;by doppelganger (doppelheathen@gmail.com) | |
;This file is provided for your own use as-is. It will require the character rom data | |
;and an iNES file header to get it to work. | |
;There are so many people I have to thank for this, that taking all the credit for | |
;myself would be an unforgivable act of arrogance. Without their help this would | |
;probably not be possible. So I thank all the peeps in the nesdev scene whose insight into | |
;the 6502 and the NES helped me learn how it works (you guys know who you are, there's no |
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
#pragma once | |
#include "util/types.hpp" | |
#include "util/std.hpp" | |
#include "util/ndarray.hpp" | |
#include "util/collections.hpp" | |
#include "util/rand.hpp" | |
#include "util/hash.hpp" | |
#include "util/assert.hpp" | |
#include "util/bitset.hpp" |
scph5500.bin 26-Aug-2018 20:47 512.0K
scph5501.bin 26-Aug-2018 20:47 512.0K
scph5502.bin 26-Aug-2018 20:47 512.0K
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
@ECHO OFF | |
if EXIST "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" goto UNLOCK | |
if NOT EXIST Private goto MDPrivate | |
:CONFIRM | |
echo Are you sure to lock this folder? (Y/N) | |
set/p "cho=>" | |
if %cho%==Y goto LOCK | |
if %cho%==y goto LOCK | |
if %cho%==n goto END | |
if %cho%==N goto END |
Windows command | Unix command | Notes |
---|---|---|
set | env | Set on Windows prints a list of all environment variables. For individual environment variables, set is the same as echo $ on Unix. |
set Path | export $PATH | Print the value of the environment variable using set in Windows. |
set PROJ | -- | result: PROJ=c:\project |
echo %PROJ% | echo $PROJ | result: c:\project |
|
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
/** | |
* WordPress dependencies | |
*/ | |
import { createPortal, useEffect, useState } from '@wordpress/element'; | |
import { registerPlugin } from '@wordpress/plugins'; | |
import { Button } from '@wordpress/components'; | |
function MyToolbarButton() { | |
// Lazy and one time initializations, also gives us a stable reference. | |
const [ container ] = useState( () => { |
Where does SwiftData store things on the Mac?
On iOS, this directory is in the app's own storage location (app_UUID/Library/Application Support) but, on the Mac, it's a shared location in the user's Library.
By default on the Mac, SwiftData stores its model in the /~/Library/Application Support directory as default.store
. (It will also add two other files, default.store-shm
and default.store-wal
, as the model is stored as a SQLite database, and these are these additional files are part of how SQLite works.)
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
public async Task LogNetworkRequests(IWebDriver driver) | |
{ | |
INetwork interceptor = driver.Manage().Network; | |
interceptor.NetworkRequestSent += OnNetworkRequestSent; | |
interceptor.NetworkResponseReceived += OnNetworkResponseReceived; | |
await interceptor.StartMonitoring(); | |
driver.Url = "http://the-internet.herokuapp.com/redirect"; | |
await interceptor.StopMonitoring(); | |
} |
NewerOlder