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 readFile = async (filePath: string): Promise<string> => { | |
try { | |
const data = await fs.promises.readFile(filePath, 'utf8'); | |
return data; | |
} catch (err) { | |
console.log(err); | |
return ''; | |
} | |
}; |
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 { ClientProxy } from '@nestjs/microservices'; | |
const clientMock: Partial<ClientProxy> = {}; | |
describe('test', () => { | |
beforeEach(async () => { | |
const app: TestingModule = await Test.createTestingModule({ | |
/* | |
... | |
*/ |
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
/* auto-grid.css by Jessiree de Vera */ | |
.auto-grid, .auto-grid-auto-grid-x1{ | |
display: grid; | |
grid-template-columns: 1fr; | |
grid-column-gap: 2rem; | |
grid-row-gap: 2rem | |
} | |
.auto-grid.auto-grid-x2 { | |
grid-template-columns: 1fr 1fr; |
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
{ | |
"title": "Lorem Ipsum", | |
"subtitle": "Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit...", | |
"content": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam nec tortor est. Duis consequat in risus ut bibendum. Aenean a ultricies nibh. Donec cursus arcu eu arcu euismod viverra. Vestibulum fermentum lectus sapien. Phasellus ac diam et velit euismod maximus. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam finibus vehicula ante. Aliquam eu lectus dolor. Cras molestie massa ac faucibus tempor. Sed id libero magna. Integer metus tortor, efficitur sed elit id, scelerisque sollicitudin massa. Proin nec felis leo. Curabitur finibus congue sapien in fringilla. Ut tempor lectus enim, non congue metus ultrices at. Donec ut facilisis ex. Donec ultricies sed est nec finibus. Suspendisse potenti. Proin maximus tristique dolor, a interdum dui dapibus sed. Interdum et malesuada fames ac ante ipsum primis in faucibus. Vestibulum nulla nisi, luct |
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
/* | |
Developer: Jessiree de Vera | |
jquery.repeater repeaterVal() work-around support input type="number" | |
*/ | |
function repeaterVal2(repeaterSelector){ | |
// repeaterSelector is the same selector used in jquery repeater init | |
if($(repeaterSelector).length > 0){ | |
var values = {}; |
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
# removes the file from git versioning | |
git rm --cached file.txt | |
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
# based on http://docs.python-requests.org/en/master/user/quickstart/ | |
# don't forget to `pip install requests` | |
import requests, json | |
API_URL = 'your_api_url' | |
headers = {'key1': 'value1', 'key2': 'value2'} # headers | |
payload = {"datakey1" : "datavalue2"} # json request values | |
r = requests.put(API_URL, headers = headers, json=payload) # put request | |
print(headers) | |
print(payload) | |
print(r.json()) |