Skip to content

Instantly share code, notes, and snippets.

Esteban Manchado Velázquez emanchado

Block or report user

Report or block emanchado

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View lyrics-to-srt.sh
#!/bin/bash
LYRICS_FILE=$1
previous_timing=
previous_text=
counter=1
while IFS='' read -r line; do
View prepare-square-pattern-batch.scm
;; This Gimp script creates a 64x64 version of the given flag from the Mutant standard icon set:
;; https://mutant.tech/use/#mastodon
;;
;; Save in your ~/.gimp-2.8/scripts directory.
;; You can call it as follows:
;; gimp -i -b '(batch-prepare-square-pattern "pattern.png")' -b '(gimp-quit 0)'
;; It will create the file "pattern-square.png" with the final, 64x64 square version.
(define (batch-prepare-square-pattern pattern-path)
(let* ((pattern-image (car (gimp-file-load RUN-NONINTERACTIVE pattern-path pattern-path)))
(pattern-layer (car (gimp-image-get-active-layer pattern-image))))
View batch-apply-pattern.scm
;; This Gimp script applies a pattern (by using the "Multiply" layer mode) to another image.
;; Both images should probably have the same dimensions.
;;
;; Save in your ~/.gimp-2.8/scripts directory.
;; You can call it as follows:
;; gimp -i -b '(batch-apply-pattern "pattern.png" "target.png" "output.png")' -b '(gimp-quit 0)'
(define (batch-apply-pattern pattern-path target-image-path final-path)
(let* ((target-image (car (gimp-file-load RUN-NONINTERACTIVE target-image-path target-image-path)))
(pattern-image (car (gimp-file-load RUN-NONINTERACTIVE pattern-path pattern-path))))
(unless (= (car (gimp-image-base-type target-image)) RGB)
View admin-ui-auth-SLASH-index.js
var fs = require("fs"),
auth = require("basic-auth"),
md5 = require("apache-md5");
var heads = require("robohydra").heads,
RoboHydraHead = heads.RoboHydraHead;
function loadPasswords(filePath) {
var passwordFileContents = fs.readFileSync(filePath).toString();
var passwords = {};
View grow-sel-by4.scm
(define (script-fu-grow-sel-4 img)
(gimp-context-push)
(gimp-image-undo-group-start img)
(gimp-selection-grow img 4)
(gimp-image-undo-group-end img)
(gimp-context-pop))
(script-fu-register "script-fu-grow-sel-4"
_"<Image>/Select/Grow by 4px"
"Grows the current selection by exactly 4 pixels."
View grow-sel-by4.py
#!/usr/bin/env python
from gimpfu import *
import time
def grow_sel_4(img):
gimp.context_push()
img.undo_group_start()
pdb.gimp_selection_grow(img, 4)
View view.elm
view : Model -> Html Msg
view model =
div []
[ button [ onClick Decrement ] [ text "-" ]
, div [ countStyle ] [ text (toString model.count) ]
, button [ onClick Increment ] [ text "+" ]
, span [] [ text (" Min: " ++ (toString model.minCount)) ]
, span [] [ text (" Max: " ++ (toString model.maxCount)) ]
, span [] [ text (" Times clicked: " ++ (toString model.numberClicks)) ]
View arch.elm
init : Int -> Model
init count =
Model 0
type alias Model =
{ count : Int
, minCount : Int
, maxCount : Int
View select-choo-test.js
const choo = require('choo')
const html = require('choo/html')
const app = choo()
app.model({
state: { selected: 'second' },
reducers: {
update: (data, state) => ({ selected: data })
}
})
View bug.html
<head>
<meta charset="utf-8" />
<title>ProseMirror test</title>
</head>
<body>
<div id="editor"></div>
<div id="content" style="display: none">
<p>First paragraph.</p>
You can’t perform that action at this time.