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
| DEL /F/Q/S "%1" > NUL | |
| RMDIR /Q/S "%1" |
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
| Year 2022! | |
| Here is how to make repos private: | |
| curl -u <user_name>:<POWERFUL_PAT> -X PATCH -H "Accept: application/vnd.github.nebula-preview+json" -d "{\"visibility\":\"private\"}" https://<org_server>/api/v3/repos/{user_name}/{repo_name} | |
| And this is how you move a repo to another user | |
| curl -u <user_name>:<POWERFUL_PAT> -X POST -H "Accept: application/vnd.github.nebula-preview+json" -d "{\"new_owner\":\"platts\",\"team_ids\":[278,186]}" https://<org_server>/api/v3/repos/{user_name}/{repo_name}/transfer | |
| Get the ID of a team by using | |
| curl -u <user_name>:<POWERFUL_PAT> -H "Accept: application/vnd.github.nebula-preview+json" https://<org_server>/api/v3/orgs/platts/teams/{team_name} |
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
| // Javascript code | |
| const snippets = [ | |
| { | |
| label: "fk", | |
| kind: monaco.languages.CompletionItemKind.Snippet, | |
| insertText: "fk ${1:table_name}.${2:field}", | |
| insertTextRules: monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet, | |
| documentation: "Foreign key to table field statement" | |
| }, | |
| { |
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
| // Check http://pinvoke.net/default.aspx/advapi32/LogonUser.html for Win32 functions and structures. | |
| // Code based on answer on SO: https://stackoverflow.com/a/11672293/315151 | |
| // Impersonates as a user like "runas /netonly" feature. | |
| public static void Impersonate(string userName, string password, string domain, Action action) | |
| { | |
| if (action == null) | |
| { | |
| return; |
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
| REM Example: Launching CMD with modified path, as another user. | |
| runas /netonly /user:DOMAIN\user_name "C:\Windows\System32\cmd.exe /K set \"PATH=%%PATH%%;C:\Program Files (x86)\Microsoft SQL Server Management Studio 18\Common7\IDE\"" |
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 Kerberos = require('kerberos').Kerberos; | |
| var kerberos = new Kerberos(); | |
| var Ssip = require('kerberos').SSIP; | |
| var http = require('http'); | |
| var urlParser = require('url'); | |
| var curl = urlParser.parse("http://<your SPNEGO protected endpoint>/"); | |
| var requestOptions = { | |
| host: curl.hostname, |
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
| const check = require('./typeCheck'); | |
| const Base = () => { | |
| console.log("base"); | |
| return this; | |
| } | |
| const Derived = function () { | |
| Base.call(this); |
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
| const requestAsync = require('./requestAsync'); | |
| let options = { | |
| uri: 'http://localhost:3000/endpoint', | |
| method: 'POST', | |
| json: {} // your data | |
| }; | |
| async function main() { | |
| let result = await requestAsync(options); |