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
// XORCipher - Super simple encryption using XOR and Base64 | |
// Usage | |
// -------- | |
// | |
// XORCipher.encode("test", "foobar"); // => "EgocFhUX" | |
// XORCipher.decode("test", "EgocFhUX"); // => "foobar" | |
// | |
// Copyright © 2013 Devin Weaver <[email protected]> | |
// | |
// This program is free software. It comes without any warranty, to |
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
<html> | |
<head> | |
<title>Snippets</title> | |
<style> | |
body{ | |
margin:0; | |
} | |
.container{ | |
display: flex; | |
justify-content: center; |
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 {AfterViewInit, Component, OnInit, QueryList, ViewChild, ViewChildren} from '@angular/core'; | |
import {Observable, Scheduler} from 'rxjs/Rx'; | |
/** | |
* | |
* From Scheduler source code: | |
* | |
* @property {Scheduler} queue Schedules on a queue in the current event frame |
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 { ModuleWithProviders, NgModule } from '@angular/core'; | |
import { CommonModule } from '@angular/common'; | |
import { Injectable, Inject } from '@angular/core'; | |
import * as WooCommerceAPI from 'woocommerce-api'; | |
//For exporting the service: | |
//import { WooApiService } from './src/woocommerce.service'; | |
//export * from './src/woocommerce.service'; |
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
export class AngularIndexedDB { | |
utils: Utils; | |
dbWrapper: DbWrapper; | |
constructor(dbName: string, version: number) { | |
this.utils = new Utils(); | |
this.dbWrapper = new DbWrapper(dbName, version); | |
} | |
openDatabase(version: number, upgradeCallback?: Function) { |
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
version: '3.3' | |
services: | |
db: | |
image: mariadb:latest | |
volumes: | |
- ./db_data:/var/lib/mysql | |
ports: | |
- "3308:3306" | |
restart: always |
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
[Unit] | |
Description=docker-wordpress | |
Requires=docker.service | |
After=docker.service | |
[Service] | |
Restart=always | |
WorkingDirectory=/home/dfa1324/docker-wordpress |
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 * as mysql from "mysql"; | |
import {MysqlError, Pool, PoolConnection} from "mysql"; | |
import {dbMysqlConf} from "./config"; | |
const MAX_ATTEMPS = 10; | |
let attempts = 0; | |
export const managePoolConnection = (app:any) => new Promise((resolve: (status:string) => void, reject: (status:string) => void) => { | |
let pool: Pool = mysql.createPool(dbMysqlConf); |
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 {Request, Response} from "express"; | |
import { | |
Collection, | |
DeleteWriteOpResultObject, | |
InsertOneWriteOpResult, | |
MongoClient, | |
ObjectID, | |
UpdateWriteOpResult | |
} from "mongodb"; | |
import {dbConf} from "../config"; |
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
/** | |
The corvid doc api is not correct | |
Actually using the doc we get | |
Error message: "No coupon type" | |
Here is the code to fix this: | |
*/ | |
OlderNewer