Skip to content

Instantly share code, notes, and snippets.

View sibelius's full-sized avatar
🦈
give me a feedback https://entria.feedback.house/sibelius

Sibelius Seraphini sibelius

🦈
give me a feedback https://entria.feedback.house/sibelius
View GitHub Profile
@sibelius
sibelius / questions.md
Last active March 20, 2023 22:46
How would you answer that? send in a reply or to me in a DM

1. What is your name, location, and age?

2. Are you currently employed? When would you be available to start?

3. Can you briefly describe (1 to 2 paragraphs) your professional experience? Where have you worked before, what were your responsibilities, etc.?

4. This position requires prior experience in management and leadership. Have you ever led a team in an Engineering Manager or similar role?

5. How would you ensure the efficient delivery of high-quality software products within tight deadlines?

@sibelius
sibelius / php-post.php
Created March 17, 2023 14:45
simple php post
<?php
// Set headers to allow cross-origin resource sharing (CORS)
header("Access-Control-Allow-Origin: *");
header("Content-Type: application/json; charset=UTF-8");
header("Access-Control-Allow-Methods: POST");
header("Access-Control-Allow-Headers: Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With");
// Get the JSON data sent in the request body
$request_body = file_get_contents('php://input');
const useLoaderPreloadedQuery<Query> = () => {
const preloadedQueryRef = useLoaderData() as PreloadedQuery<Query>;
// clean up is important as we are using loadQuery directly without useQueryLoader
/ which will handle to dispose auto.
useEffect(() => () => preloadedQueryRef.dispose(), [preloadedQueryRef]);
return preloadedQueryRef
}
@sibelius
sibelius / mongooseObjectIdToString.ts
Created March 9, 2023 01:48
transform all ObjectId inside an object to a string to make it easy test assertions
import mongoose from 'mongoose';
const { ObjectId } = mongoose.Types;
// transform all ObjectId to string
export const mongooseObjectIdToString = (data: any) => {
if (!data) {
return data;
}
@sibelius
sibelius / prototype.js
Created March 8, 2023 19:56
prototype.js amoptimization
const Prototype = {
Version: '1.7',
Browser: (function () {
const ua = navigator.userAgent;
const isOpera =
Object.prototype.toString.call(window.opera) == '[object Opera]';
return {
IE: !!window.attachEvent && !isOpera,
Opera: isOpera,
@sibelius
sibelius / missingFieldHandler.ts
Created February 24, 2023 11:30
missingFieldHandler
import { ROOT_TYPE } from 'relay-runtime';
import type { MissingFieldHandler } from 'relay-runtime/lib/store/RelayStoreTypes';
export const missingScalarDebug = {
kind: 'scalar',
handle(field, record, args, store) {
// eslint-disable-next-line
console.log('missing scalar', {
field,
record,
@sibelius
sibelius / relayLog.ts
Created February 24, 2023 11:28
relay logging options
export const relayTransactionLogger = (event: LogEvent) => {
if (!isDev) {
return;
}
// eslint-disable-next-line
console.log('RELAY: ', event);
return;
}
@sibelius
sibelius / .eslintrc.js
Created February 22, 2023 20:49
empty .eslintrc.js
module.exports = {
extends: [
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 10,
sourceType: 'module',
ecmaFeatures: {
modules: true,
},
@sibelius
sibelius / app.spec.tsx
Created February 7, 2023 15:57
ssr test html
it('test SSR', async () => {
const response = await request(app.callback()).get('/').send();
expect(response.status).toBe(200);
const { getByText } = renderHtml(response.text);
expect(getByText('my data')).toBeTruthy();
});
@sibelius
sibelius / ml-roadmap.md
Created January 17, 2023 11:30
Machine Learning Roadmap

Machine Learning Roadmap

  • calculus (learn how to find zero of a function, and what is a gradient)
  • unsupervised learning (k-means, and other cluster algorithm)
  • supervised learning (linear regression, svn, neural net)
  • reinforcement learning (llm)
  • learn state of art (convolution network, deep learning, attention)