sudo -i
PIP_REQUIRE_VIRTUALENV=false pip uninstall virtualenv
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 class QueryInterceptor : DbCommandInterceptor | |
{ | |
public const string TagPrefix = "QueryInterceptor:"; | |
public override InterceptionResult<DbDataReader> ReaderExecuting( | |
DbCommand command, | |
CommandEventData eventData, | |
InterceptionResult<DbDataReader> result) | |
{ | |
ManipulateCommand(command: command); |
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
var result = await PublicClientApplicationBuilder.CreateWithApplicationOptions(options: new() | |
{ | |
ClientId = "8bxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", | |
TenantId = "1exxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" | |
}) | |
.WithRedirectUri(redirectUri: "http://localhost") | |
.Build() | |
.AcquireTokenInteractive(scopes: "api://7fxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/some.web.api openid profile offline_access".Split(separator: ' ')) | |
.WithAccount(account: PublicClientApplication.OperatingSystemAccount) | |
.WithPrompt(prompt: Prompt.NoPrompt) |
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
#!/usr/bin/env node | |
// You need self-signed certs at first | |
// $ openssl req -nodes -new -x509 -keyout server.key -out server.cert | |
// Native | |
const https = require('https'); | |
const fs = require('fs'); | |
const {promisify} = require('util'); | |
const dns = require('dns'); |
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
git init | |
git add . | |
git commit -m "Initial commit" | |
git remote add origin [email protected]:cobysy/somerepo.git | |
git push --force origin master:gh-pages |
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
declare global { | |
interface Array<T> { | |
sortBy(selector: (elem: T) => any): T[]; | |
} | |
} | |
if (!Array.prototype.sortBy) { | |
Array.prototype.sortBy = function <T>(selector: (elem: T) => any): T[] { | |
return this.sort((a, b) => { | |
return selector(a) < selector(b) ? -1 : 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
const http = require('http'); | |
const url = require('url'); | |
const path = require('path'); | |
const fs = require('fs'); | |
function wget(source, { onStart, onProgress } = {}) { | |
return new Promise(function(y, n) { | |
const output = path.basename(url.parse(source).pathname); | |
const req = http.request(source, |
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
#!/bin/sh | |
# v = verbose | |
# z = reduce the network transfer by adding compression | |
# P = combines the flags --progress and --partial. | |
# The first of these gives you a progress bar for the transfers and the second allows you to resume interrupted transfers | |
rsync -vzP ftp.edrdg.org::nihongo/JMdict_e . |
Was facing this stupid error message:
~/anaconda3 ❯❯❯ bin/conda install tensorflow Solving environment: failed
UnsatisfiableError: The following specifications were found to be in conflict:
- scikit-image -> numpy[version='>=1.13.3,<2.0a0']
- tensorflow Use "conda info " to see the dependencies for each package.
NewerOlder