Skip to content

Instantly share code, notes, and snippets.

@Yanrishatum
Yanrishatum / hlc.md
Last active May 20, 2024 17:16
How to compile HL/C

How to compile HL/C

Prepwork/terms

Because I have no trust in people.

  • <hashlink> points to your installation of Hashlink, e.g. folder in which hl.exe (or Unix executable) is, alongside with library binaries (.hdll files), and include folder.
  • <src> points to the folder containing generated HL/C sources. One that contains hlc.json file.
  • <app> refers to your output executable name, including extension.
  • <main> refers to your entry-point file name, including extension (see below).
  • I provide example of doing it on Windows via MSVC cl.exe, but Unix should be more or less same with replacement of argument flags and compiler.
  • I expect that you DO have a compiler installed and can call cl.exe or other compiler from command-line.
@paulirish
paulirish / what-forces-layout.md
Last active May 20, 2024 17:15
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent

DX7

image

Note: One of the algorithms is incorrect due to a missing operator. Need to update the image. Will have to get on that soon.

These are the original 32 algorithms as used in Yamaha DX7.

The later Yamaha FS1R and Yamaha SY77 may have compatibility with these algorithms, but that's beyond the current scope. The FS1R contains 88 algorithms, while the SY77 contains 45 algorithms.

@rinogo
rinogo / job.service.spec.ts
Last active May 20, 2024 17:09
Integration Testing a NestJS Service that leverages Prisma
import { Test, TestingModule } from '@nestjs/testing';
import { PrismaService } from '../prisma.service';
import { JobService } from './job.service';
import * as crypto from 'crypto';
describe('JobService', () => {
let service: JobService;
let prisma: PrismaService;
beforeEach(async () => {
@pgodwin
pgodwin / DecompressBlob.cs
Created August 12, 2019 07:23
Cerner LZW Decompression
using System.Text;
/* This code provided by Bruce Jackson (brucejackson.info) and is
* provided "AS IS" with no warranties, expressed or implied, as to
* its effectivness or use.
*
* User agrees to edit the code to meet their partiular use and
* understands that this code has not been fully
* tested in a production environment.
*
@DaniruKun
DaniruKun / yt-clip.sh
Created May 17, 2021 21:08
Download YT VOD in timestamp interval
youtube-dl -f "(bestvideo+bestaudio/best)[protocol!*=dash]" --external-downloader ffmpeg --external-downloader-args "-ss 00:00:00 -to 00:00:00" "youtube link"
# taken from http://www.piware.de/2011/01/creating-an-https-server-in-python/
# generate server.xml with the following command:
# openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes
# run as follows:
# python simple-https-server.py
# then in your browser, visit:
# https://localhost:4443
import BaseHTTPServer, SimpleHTTPServer
import ssl
@luismts
luismts / GitCommitBestPractices.md
Last active May 20, 2024 17:02
Git Tips and Git Commit Best Practices

Git Commit Best Practices

Basic Rules

Commit Related Changes

A commit should be a wrapper for related changes. For example, fixing two different bugs should produce two separate commits. Small commits make it easier for other developers to understand the changes and roll them back if something went wrong. With tools like the staging area and the ability to stage only parts of a file, Git makes it easy to create very granular commits.

Commit Often

Committing often keeps your commits small and, again, helps you commit only related changes. Moreover, it allows you to share your code more frequently with others. That way it‘s easier for everyone to integrate changes regularly and avoid having merge conflicts. Having large commits and sharing them infrequently, in contrast, makes it hard to solve conflicts.

#!/bin/bash
#SBATCH --account=3214046
#SBATCH --partition=dsba
#SBATCH --gpus=1
#SBATCH --mem=10G
#SBATCH --job-name="check"
#SBATCH --time=03:00:00
#SBATCH --output=/home/3214046/my_dir/output/%x.out
#SBATCH --error=/home/3214046/my_dir/error/%x.err
1.Run git clone <my-cool-project>
2.Run composer install
3.Run cp .env.example .env
4.Run php artisan key:generate
5.Run php artisan migrate
6.Run php artisan serve
7.Go to link localhost:8000