Skip to content

Instantly share code, notes, and snippets.

View miromannino's full-sized avatar
💻

Miro Mannino miromannino

💻
View GitHub Profile
@miromannino
miromannino / codeblock.tsx
Created May 24, 2024 11:43
Customizable Code Block Component with shadcn/ui
import React, { useRef } from "react";
import { cn } from "@/lib/utils";
import CodeEditor from "@uiw/react-textarea-code-editor";
export interface CodeBlockProps
extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {
language?: string;
darkMode?: boolean;
}
@miromannino
miromannino / macos-defaults.sh
Last active March 5, 2024 10:25
MacOS defaults
# Show hidden files
defaults write com.apple.finder AppleShowAllFiles -boolean true
# Show status bar in Finder
defaults write com.apple.finder ShowStatusBar -bool true
# Show Library folder
chflags nohidden ~/Library
# Show file extensions
@miromannino
miromannino / README.md
Last active December 10, 2023 22:52
Download Wistia videos in a Teachable course to be able to watch offline

Go to your teachable course and show the page where videos are.

Now open your Browser's console. For example in Chrome you can press F12 to open it.

Paste the following code in the console

$('.attachment-wistia-player').each(function () { console.log($(this).attr('data-wistia-id')); });

Press enter to retrieve all videos IDs that are present in the opened page. For example:

@miromannino
miromannino / README.md
Created May 16, 2020 19:13
Convert .mov or .mp4 to .gif

How to convert .mov or .mp4 to .gif using the command line

Requirements

brew install ffmpeg
brew install gifsicle

How to convert

@miromannino
miromannino / compile-monetdb-in-macos.md
Created March 16, 2020 12:46
Compile monetdb in macos from source
@miromannino
miromannino / SIDConverter.java
Last active February 10, 2022 14:03
Convert a SID to String with Java
public class SIDConverter {
public static String convertSidToStringSid(byte[] sid) {
int offset, size;
// sid[0] is the Revision, we allow only version 1, because it's the
// only that exists right now.
if (sid[0] != 1)
throw new IllegalArgumentException("SID revision must be 1");
@miromannino
miromannino / new_gist_file.css
Created August 23, 2016 07:23
glyphicon-refresh-animate
.glyphicon-refresh-animate {
-animation: spin .7s infinite linear;
-webkit-animation: spin2 .7s infinite linear;
}
@-webkit-keyframes spin2 {
from { -webkit-transform: rotate(0deg);}
to { -webkit-transform: rotate(360deg);}
}
@miromannino
miromannino / info.txt
Created August 22, 2016 09:07
Home End Keys in Apple keyboard
One option is to create ~/Library/KeyBindings/ and save a property list like this as ~/Library/KeyBindings/DefaultKeyBinding.dict:
{
"\UF729" = moveToBeginningOfLine:;
"\UF72B" = moveToEndOfLine:;
"$\UF729" = moveToBeginningOfLineAndModifySelection:;
"$\UF72B" = moveToEndOfLineAndModifySelection:;
}
Quit and reopen applications to apply the changes. Note that DefaultKeyBinding.dict is not supported by some applications like Xcode or Firefox.
@miromannino
miromannino / README.md
Created December 15, 2015 07:51 — forked from lopezjurip/README.md
Write to NTFS on OSX Yosemite and El Capitan

Install Homebrew:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Update Homebrew formulae:

brew update
@miromannino
miromannino / index.html
Created October 4, 2015 13:55
Use PaperJS with AngularJS (as reported in http://stackoverflow.com/a/32934066/2867909)
<!DOCTYPE html>
<html ng-app="PaperAngularExample">
<head>
<script type="text/javascript" src="bower_components/angular/angular.js"></script>
<script type="text/javascript" src="bower_components/paper/dist/paper-full.js"></script>
<script>
var app = angular.module('PaperAngularExample', []);
app.directive('draw', function() {
return {