Skip to content

Instantly share code, notes, and snippets.

View marcoroth's full-sized avatar
🚀
Shipping

Marco Roth marcoroth

🚀
Shipping
View GitHub Profile
@noestreich
noestreich / dark.css
Created October 22, 2019 06:12
Dark mode in a website with CSS
@media (prefers-color-scheme: dark) {
body {
background-color: #444;
color: #e4e4e4;
}
a {
color: #e39777;
}
img {
filter: grayscale(30%);
@borama
borama / ruby_gems_age.rb
Last active October 25, 2023 21:03
A script that collects and prints info about the age of all ruby gems in your project, see https://dev.to/borama/how-old-are-dependencies-in-your-ruby-project-3jia
#!/bin/env ruby
#
# Collects info about the age of all gems in the project
#
require "json"
require "date"
bundle = `bundle list`
yearly_stats = {}
@bessfernandez
bessfernandez / setting-up-html-storybook-app.md
Last active September 11, 2024 16:04
How to setup a simple Storybook HTML demo app

icon-storybook-default

Storybook for HTML

Storybook is all about writing stories. A story usually contains a single state of one component, almost like a visual test case.

Typically you see Storybook used for React or other frameworks, but the library has recently introduced the option to use HTML for your Storybook projects. As a prototyping tool or playground this is great! No larger scale knowledge of other frameworks needed.

Install Storybook HTML

@Aidurber
Aidurber / cleanup.sh
Last active September 29, 2022 13:14
A handy script to clean up a mac thanks to - Gant Laborde's article: https://medium.freecodecamp.org/how-to-free-up-space-on-your-developer-mac-f542f66ddfb
# Cleanup old node_modules
echo "Cleaning node_modules in projects older than 30 days"
find . -name "node_modules" -type d -mtime +30 | xargs rm -rf
echo "Done cleaning node_modules"
# Clean up homebrew
echo "Clean homebrew"
brew update && brew upgrade && brew cleanup
echo "Done cleaning homebrew"

Investigating Strange Behavior on QNAP NAS Server

TL;DR - It's mining Monero (XMR), hidden under the guise of the McAfee app. Remove it (who wants McAfee anyways?).

Long Version

After a reboot, logging in over SSH and checking for active screen sessions revealed this:

[~] # screen -ls
@gravitylow
gravitylow / codesign_gdb.md
Last active March 10, 2025 16:38 — forked from hlissner/codesign_gdb.md
Codesign gdb on macOS

If you are getting this in gdb on macOS while trying to run a program:

Unable to find Mach task port for process-id 57573: (os/kern) failure (0x5).
 (please check gdb is codesigned - see taskgated(8))
  1. Open Keychain Access
  2. In menu, open Keychain Access > Certificate Assistant > Create a certificate
  3. Give it a name (e.g. gdbc)
@tnewman
tnewman / atoi.asm
Last active September 27, 2024 05:23
atoi in Assembly - Convert a number string to a 64 bit integer.
global atoi
section .text
atoi:
mov rax, 0 ; Set initial total to 0
convert:
movzx rsi, byte [rdi] ; Get the current character
test rsi, rsi ; Check for \0
@Bhavdip
Bhavdip / sketch-never-ending.md
Created October 6, 2016 15:53
Modify Sketch to never ending trial

###Sketch trial non stop

Open hosts files:

$ open /private/etc/hosts

Edit the file adding:

127.0.0.1 backend.bohemiancoding.com

127.0.0.1 bohemiancoding.sketch.analytics.s3-website-us-east-1.amazonaws.com

@zentetsukenz
zentetsukenz / ruby_on_rails_deployment.md
Last active December 2, 2024 01:26
Deploy Ruby on Rails application with Docker Compose and Capistrano with ease

Docker

Files and Folders.

|
|\_ app
|...
|\_ docker
| |
# config/routes.rb
resources :documents do
scope module: 'documents' do
resources :versions do
post :restore, on: :member
end
resource :lock
end
end