Skip to content

Instantly share code, notes, and snippets.

View miromannino's full-sized avatar
💻

Miro Mannino miromannino

💻
View GitHub Profile
@miromannino
miromannino / service.md
Last active February 27, 2024 18:41 — forked from naholyr/_service.md
Sample /etc/init.d script

Sample service script for debian/ubuntu

Look at LSB init scripts for more information.

Usage

Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name
@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 {
@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 / 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 / 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 / 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 / compile-monetdb-in-macos.md
Created March 16, 2020 12:46
Compile monetdb in macos from source
@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 / 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 / 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