Skip to content

Instantly share code, notes, and snippets.

@tuxfight3r
tuxfight3r / 01.bash_shortcuts_v2.md
Last active April 25, 2024 14:08
Bash keyboard shortcuts

Bash Shortcuts

visual cheetsheet

Moving

command description
ctrl + a Goto BEGINNING of command line
@jbsarrodie
jbsarrodie / Delete unused elements and relationships.ajs
Created March 2, 2020 15:33
#jArchi scripts to delete any element (or relationship) not used in at least one view
// Delete unused elements and relationships
//
// Requires jArchi - https://www.archimatetool.com/blog/2018/07/02/jarchi/
//
// This script will delete any element or relationship not used in at least one view
//
// (c) 2020 Jean-Baptiste Sarrodie
var response = window.confirm("This script will delete any element or relationship not used in at least one view. Continue?");
@smileham
smileham / Export to Markdown.ajs
Last active April 25, 2024 14:06
Export an ArchiMate diagram to Markdown format. #jarchi
/*
* Export View to Markdown
*
* Requires jArchi - https://www.archimatetool.com/blog/2018/07/02/jarchi/
*
* Markdown - https://www.markdownguide.org/
*
* Version 2: Updated to support Diagram Groups
* Version 2.1: Add check for Selected View
* Version 2.2: Change to regex, added date of export
@perrysmotors
perrysmotors / ScrollEffects.tsx
Last active April 25, 2024 14:06
Overrides to create scroll interactions on Framer sites
import type { ComponentType } from "react"
import { useState, useEffect } from "react"
import type { MotionValue, Transition } from "framer-motion"
import {
useScroll,
useVelocity,
useTransform,
useMotionValue,
animate,
@zaiedsarra
zaiedsarra / hello.c
Last active April 25, 2024 14:05
Mon hello word
int main()
{
printf("Hello world");
return 0;
}
@valferon
valferon / postgres_manager.py
Created March 29, 2018 02:35
Python script to take care of postgres backup and restore of data
#!/usr/bin/python3
import argparse
import logging
import subprocess
import os
import tempfile
from tempfile import mkstemp
import configparser
import gzip
@adrianhajdin
adrianhajdin / Loader.jsx
Created January 20, 2023 10:50
Build and Deploy a Full Stack MERN AI Image Generation App & MidJourney & DALL E Clone
import React from 'react';
const Loader = () => (
<div role="status">
<svg aria-hidden="true" className="inline w-10 h-10 mr-2 text-gray-200 animate-spin fill-[#6469ff]" viewBox="0 0 100 101" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z" fill="currentColor" />
<path d="M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511
@dyjjones
dyjjones / torrent.py
Created July 6, 2015 03:56
download torrent files
import urllib2
import json
from sys import argv
from bs4 import BeautifulSoup
import StringIO
import gzip
import sh
import zlib
url = "http://metasearch.torrentproject.com/torrenttojson4.php?site=kat.cr&search={}&output=json".format('%20'.join(argv[1:]))
@steveruizok
steveruizok / tldraw-tiptap.ts
Created June 19, 2023 14:26
tldraw x tiptap
import { Node, mergeAttributes } from "@tiptap/core";
import { NodeViewWrapper, ReactNodeViewRenderer } from "@tiptap/react";
import { Tldraw } from "@tldraw/tldraw"; // use @tldraw/tldraw@canary
import "@tldraw/tldraw/tldraw.css";
function Component() {
return (
<NodeViewWrapper className="react-component">
<div style={{ width: "100%", height: 500 }}>
<Tldraw />