Skip to content

Instantly share code, notes, and snippets.

View mikomatic's full-sized avatar

Miguel Ortega mikomatic

View GitHub Profile
@mikomatic
mikomatic / autorebase.java
Last active August 28, 2022 20:22
Gitlab autorebase with jbang and picocli
///usr/bin/env jbang "$0" "$@" ; exit $?
//JAVA 17+
//DEPS info.picocli:picocli:4.5.0
//DEPS org.gitlab4j:gitlab4j-api:5.0.1
import org.gitlab4j.api.Constants;
import org.gitlab4j.api.GitLabApi;
import org.gitlab4j.api.models.MergeRequest;
import picocli.CommandLine;
import picocli.CommandLine.Command;
@mikomatic
mikomatic / README.md
Created August 21, 2021 16:45 — forked from cjtallman/README.md
Vagrant Gitlab Server

Vagrant Gitlab Server

Quickly set up a local Gitlab CE server using Vagrant.

Run vagrant up to setup the virtual server.

Server Details

  • Ubuntu 16.04
  • Installs latest Docker
@startuml OAuth basic flow with auth code and access token
skinparam monochrome true
skinparam defaultFontSize 14
' plantuml: https://plantuml.com/sequence-diagram
' source: https://gist.github.com/hrchu/d88efb56e72534a1233d16f36eb3e3e9
title OAuth basic flow with auth code and access token
actor "You/Browser" as b
participant "slack.com" as s
@mikomatic
mikomatic / monokai-light.js
Created March 20, 2016 21:25
Ace Editor monokai-light Theme
ace.define("ace/theme/monokai-light", ["require", "exports", "module", "ace/lib/dom"], function(acequire, exports, module) {
exports.isDark = true;
exports.cssClass = "ace-monokai-light";
exports.cssText = ".ace-monokai-light .ace_gutter {background: transparent;color: #bbb;width:50px;}.ace-monokai-light .ace_print-margin {width: 1px;background: transparent}.ace-monokai-light {background-color: transparent;color: #555}.ace-monokai-light .ace_cursor {color: #333;border-right:0;border-left-width:1px;}.ace-monokai-light .ace_marker-layer .ace_selection {background: rgba(212, 14, 103, 0.1);background:#b1d3ff;background:#e6e6e6;}.ace-monokai-light.ace_multiselect .ace_selection.ace_start {border-radius: 2px}.ace-monokai-light .ace_marker-layer .ace_step {background: rgb(102, 82, 0)}.ace-monokai-light .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #49483E}.ace-monokai-light .ace_marker-layer .ace_active-line {background: transparent;}.ace-monokai-light .ace_gutter-active-line {
@mikomatic
mikomatic / fluidvis.js
Created July 21, 2014 13:01
Angularjs directive for responsive videos
/* Handle responsive video
* Full credit goes to Todd Motto @toddmotto
* http://toddmotto.com/creating-an-angularjs-directive-from-one-of-your-existing-plugins-scripts/
*/
blogApp.directive('fluidvids',['$sce', function ($sce) {
return {
restrict: 'EA',
replace: true,
@mikomatic
mikomatic / ng-prism.js
Created July 17, 2014 14:02
Angularjs directive with prism code highlight
/**
* Usage
*
* <ng-prism class="language-css">
* body {
* color: red;
* }
* </ng-prism>
*
* the files prismjs and prism css must be included in HTML, use class "language-XXX" to specify language
<link rel="import" href="../notification-elements/notification-alert.html">
<link rel="import" href="../paper-tabs/paper-tab.html">
<link rel="import" href="../paper-button/paper-button.html">
<polymer-element name="my-element">
<template>
<style>
#notification_alert {
left: 580px;
@mikomatic
mikomatic / agoTime
Created July 11, 2013 09:32
Random javascript functions: - linkfy - detect url in text ans transforms them to links - agoTime, helper to display a date twitter like (eg. 5 days ago)
function timeDiff(current, previous) {
var msPerMinute = 60 * 1000;
var msPerHour = msPerMinute * 60;
var msPerDay = msPerHour * 24;
var msPerMonth = msPerDay * 30;
var msPerYear = msPerDay * 365;
var elapsed = current - previous;
@mikomatic
mikomatic / notepad2.html
Created July 10, 2013 14:48
A simple web editor (markdown converter too, using Ace + Showdown)
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="utf-8" />
<meta name="author" content="Miguel O.">
<meta name="description" content="A simple web notepad">
<title>Custom Editor</title>
<link rel="shortcut icon" href="http://elmike.net/favicon.ico"/>
<style type="text/css">
@mikomatic
mikomatic / notepad.html
Last active July 14, 2018 12:28 — forked from jdkanani/notepad.html
bookmarkable simple web editor. Simple Copy paste the code below in your browser's adress bar. Tested (pretty quickly though ^_^) on latest versions of FF, Chrome on OSX and windows
data:text/html;charset=utf-8,
<title>Custom Editor</title><link rel="shortcut icon" href="http://elmike.net/favicon.ico"/>
<style type="text/css">
.e{
position:absolute;
top:20px;
right:50%;
bottom:20px;
left:0;
}