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
using System; | |
using System.Diagnostics; | |
using System.Runtime.InteropServices; | |
using System.Runtime.CompilerServices; | |
using System.Windows.Input; | |
using System.Windows.Threading; | |
using System.Collections.Generic; | |
namespace Ownskit.Utils | |
{ |
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
import { createSQLiteThread, createHttpBackend } from "npm:sqlite-wasm-http"; | |
// This is required hack: | |
const OldWorker = globalThis.Worker; | |
// @ts-ignore: Default to module workers | |
globalThis.Worker = class { | |
constructor(url: URL, opts: any = {}) { | |
return new OldWorker(url, { type: "module", ...opts }); | |
} | |
}; |
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
using System; | |
using Microsoft.AspNetCore.Mvc; | |
using Microsoft.AspNetCore.Mvc.Filters; | |
namespace Example | |
{ | |
public class ModelStateValidationFilter : Attribute, IActionFilter | |
{ | |
public void OnActionExecuting(ActionExecutingContext context) | |
{ |
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
set filepath="C:\some path\having spaces.txt" | |
for /F "delims=" %%i in (%filepath%) do set dirname="%%~dpi" | |
for /F "delims=" %%i in (%filepath%) do set filename="%%~nxi" | |
for /F "delims=" %%i in (%filepath%) do set basename="%%~ni" | |
echo %dirname% | |
echo %filename% | |
echo %basename% |
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
[package] | |
name = "yourpackage" | |
version = "0.1.0" | |
authors = ["John Doe"] | |
edition = "2018" | |
[[bin]] | |
name = "example" | |
path = "stream-a-file-using-rust-hyper.rs" |
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/bash | |
# Author: Jari Pennanen | |
# Url: https://gist.github.com/Ciantic/4e543f2d878a87a38c25032d5c727bf2 | |
AUTH_EMAIL="john.doe@example.com" # Your Cloudflare email | |
AUTH_KEY="" # Get this from My profile -> API Keys -> View | |
DOMAIN="example.com" # main domain | |
SUBDOMAIN="home.example.com" # set A and AAAA-record of this subdomain |
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 pool = new Pool({ | |
max: 300, | |
connectionTimeoutMillis: 20000, | |
host: "127.0.0.1", | |
port: 5432, | |
user: 'citus', | |
password: () => "password", | |
database: 'citus', | |
ssl: false, |
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
<?php | |
add_action("init", function () { | |
// Ob_start twice, intentionally | |
ob_start(); | |
?> | |
<script type="module"> | |
<?php ob_start(); ?> | |
wp.blocks.registerBlockType("temp/shortcode", { |
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
import { createConnection, getConnection, Entity, getRepository } from "typeorm"; | |
import { PrimaryGeneratedColumn, Column } from "typeorm"; | |
@Entity() | |
export class MyEntity { | |
@PrimaryGeneratedColumn() | |
id?: number; | |
@Column() | |
name?: string; |
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
use std::io::Write; | |
use std::{env, path::Path}; | |
use std::{fs::OpenOptions, path::PathBuf}; | |
use regex::Regex; | |
fn main() { | |
let dir = Path::new(&env::var("CARGO_MANIFEST_DIR").unwrap()).join("lib"); | |
println!("cargo:rustc-link-search=native={}", dir.display()); |
NewerOlder