A Pen by longvanren on CodePen.
func (u *UserRepository) ListUserName(ctx context.Context, req *repositories.ListUserRequest) ([]*models.UserModel, error) {
qb := squirrel.Select("username").From(u.tableName).PlaceholderFormat(PlaceHolder)
if req.Owner != "" {
if req.Owner != "root" {
qb = qb.Where(squirrel.Eq{"owner": req.Owner})
}
}
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 () { | |
let terminal = new Terminal({ | |
screenKeys: true, | |
useStyle: true, | |
cursorBlink: true, | |
fullscreenWin: true, | |
maximizeWin: true, | |
screenReaderMode: true, | |
cols: 128, | |
}); |
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
let terminal = new Terminal({ | |
cols: 128, | |
rows: 13, | |
convertEol: true, | |
cursorBlink: true, | |
}); | |
terminal.open(document.getElementById("terminal")); | |
let bearToken = | |
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkYXRhIjp7Im9yaWdpbl91c2VybmFtZSI6IiIsInVzZXJuYW1lIjoicm9vdCJ9LCJpc3MiOiJzaW1wbGUtcGFuZWwiLCJzdWIiOiJhY2Nlc3MtdG9rZW4iLCJleHAiOjE2OTMzNTM2MDAsIm5iZiI6MTY5MzI3NTY2NSwiaWF0IjoxNjkzMjc1NjY1fQ.Jn6YSpW8F_GoUSXE-GtN-fgsEZXyy1Y5jjoe8vcuGzw"; | |
let protocol = location.protocol === "https:" ? "wss://" : "ws://"; |
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
<?php | |
$monitors = Monitor::doesntHave('uptimeRecords')->select('id', 'url')->limit(10)->get(); | |
$countMonitorsWithoutUTR = $monitors->count(); | |
if ($countMonitorsWithoutUTR < 10) { | |
$orderByDescUptimeRecord = UptimeRecord::select('id_monitor') | |
->selectRaw('MAX(checked_at) as max_checked_at') | |
->groupBy('id_monitor') | |
->orderBy('max_checked_at', 'asc') |
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
<?php | |
public function showLoginForm(\Illuminate\Http\Request $request) | |
{ | |
$sso_url = env('SSO_URL', '#') . '?callback_url=' . action('Controller@loginSSO'); | |
return view('auth.login', ['sso_url' => $sso_url]); | |
} | |
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
<?php | |
use Box\Spout\Writer\Common\Creator\WriterEntityFactory; | |
function genLogs($progressCallback, $defaultHeader, $customHeader, $ipHeader = [], $model, $total) | |
{ | |
$headers = array_merge($defaultHeader, array_values($customHeader), $ipHeader); | |
$model = '\EMA\Model\MongoDB\\' . $model; | |
$tmpTableName = 'log_' . $this->uid . '_' . md5(rand()); |
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 { PlaywrightCrawler } = require("crawlee"); | |
const { firefoxUserPrefs } = require("./firefox-user-prefs"); // this just some firefox setting in this repo https://github.com/yokoffing/BetterFox | |
const constNike = require("./const"); | |
const currentDir = __dirname; | |
const path = require("path"); | |
const { firefox } = require("playwright"); | |
const { expect } = require("playwright/test"); | |
const imageFolder = path.join(currentDir, "images"); | |
const SimpleNodeLogger = require("simple-node-logger"); | |
const fs = require("fs"); |
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 fs from 'fs'; | |
import path from 'path'; | |
import axios from 'axios'; | |
import FormData from 'form-data'; | |
// Path to the file you want to upload | |
const filePath: string = path.join(__dirname, 'yourfile.txt'); | |
// URL of the remote server | |
const url: string = 'https://example.com/upload'; |
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
<?php | |
function count_highlighted_letters($L, $N, $selections) | |
{ | |
// Initialize an array to keep track of highlighted status for each character in S | |
$highlighted = array_fill(0, $L, false); | |
// Process each selection | |
foreach ($selections as $selection) { | |
list($a, $b) = $selection; | |
// Convert to 0-based index |
OlderNewer