Skip to content

Instantly share code, notes, and snippets.

View heygema's full-sized avatar
🗽
Liberté, égalité, fraternité

Gema heygema

🗽
Liberté, égalité, fraternité
View GitHub Profile
@haskaalo
haskaalo / tarcheatsheet.md
Last active July 17, 2025 10:17
Tar usage / Tar Cheat Sheet

Tar Usage / Cheat Sheet

Compress a file or directory

e.g: tar -czvf name-of-archive.tar.gz /path/to/directory-or-file

  • -c: Create an archive.
  • -z: Compress the archive with gzip.
  • -v: makes tar talk a lot. Verbose output shows you all the files being archived and much.
  • -f: Allows you to specify the filename of the archive.
@hygull
hygull / LICENSE KEY FOR SUBLIME TEXT 3 BUILD 3143.md
Last active March 28, 2025 22:48
LICENSE KEY FOR SUBLIME TEXT 3 BUILD 3143

STEPS

  • Click on Help menu

  • Select Enter License

  • Then paste given KEY given at bottom

  • Finally click on Use License

<plist version="1.0">
<dict>
<key>author</key>
<string>IceTimux (http://icetimux.com)</string>
<key>name</key>
<string>One Dark</string>
<key>semanticClass</key>
<string>theme.dark.one_dark</string>
<key>colorSpaceName</key>
<string>sRGB</string>
@dustinrouillard
dustinrouillard / snowflake.sql
Created January 17, 2021 02:34
PostgreSQL Snowflake ID Generator Function
CREATE SEQUENCE IF NOT EXISTS public.global_id_sequence;
CREATE OR REPLACE FUNCTION id_generator(OUT result BIGINT) AS $$
DECLARE
epoch BIGINT := 1610850820000;
seq_id BIGINT;
now_millis BIGINT;
shard_id INT := 1;
BEGIN
SELECT nextval('public.global_id_sequence') % 1024 INTO seq_id;
@heygema
heygema / Post.test.ts
Last active February 23, 2021 06:14
Prisma TDD
import { createTestContext } from "./__helpers";
const ctx = createTestContext();
it("ensures that draft can be created and published", async () => {
const draftResult = await ctx.client.request(
`
mutation {
createDraft(title: "Nexus", body: "...") {
id
@DavidWells
DavidWells / github-proxy-client.js
Last active March 3, 2025 17:47
Full Github REST api in 34 lines of code
/* Ultra lightweight Github REST Client */
// original inspiration via https://gist.github.com/v1vendi/75d5e5dad7a2d1ef3fcb48234e4528cb
const token = 'github-token-here'
const githubClient = generateAPI('https://api.github.com', {
headers: {
'User-Agent': 'xyz',
'Authorization': `bearer ${token}`
}
})