This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
RED='\033[0;31m' | |
NC='\033[0m' # No Color | |
MESSAGE="${RED}Changes detected in the Gemfile.lock, consider rebuilding your container image.${NC}" | |
if [[ $3 == 1 ]]; then | |
git diff --quiet $1 $2 -- Gemfile.lock || echo -e $MESSAGE | |
fi; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
case $1 in | |
attach) | |
podman attach $(podman-compose ps | grep _$2_ | cut -d " " -f 1) | |
;; | |
*) | |
podman-compose $@ | |
;; | |
esac |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import RPi.GPIO as GPIO | |
import time | |
from subprocess import call | |
GPIO.setwarnings(False) | |
GPIO.setmode(GPIO.BOARD) | |
GPIO.setup(11, GPIO.IN) | |
while True: | |
i = GPIO.input(11) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'surro-gate' | |
require 'websocket/driver' | |
require 'rack/reverse_proxy' | |
require 'permessage_deflate' | |
class WSRack | |
attr_reader :env, :url | |
def initialize(env, sock) | |
@env = env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
path = File.join(ManageIQ::UI::Classic.root, 'app', 'assets', 'images', '100', '*.png') | |
pngs = Dir.glob(path).map { |f| File.basename(f, '.png') } | |
Rails.application.eager_load! | |
models = ApplicationRecord.descendants.reject { |m| m.decorate && (m.decorate.fonticon || m.decorate.fileicon) }.reject do |m| | |
ret = nil | |
# Some records aren't that easy to create | |
begin | |
record = m.new | |
ret = record.decorate && (record.decorate.fonticon || record.decorate.fileicon) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('#submissionInstructionsHeader').remove(); | |
$('#FwkErrorBeanId').remove(); | |
$('#PreHeaderLayout').remove(); | |
$('#DefaultFormName > table').remove(); | |
$('#LLAOutput').remove(); | |
$('#ConfirmationPgStackLayout tbody').children[1].remove(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env ruby | |
# Script to approve a GitHub PR from the command line | |
# | |
# Usage: ./approve.rb <repo> <PR> | |
# For auth configuration see: https://github.com/octokit/octokit.rb#using-a-netrc-file | |
require 'octokit' | |
require 'netrc' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'json' | |
require 'nokogiri' | |
require 'open-uri' | |
BASE = 'http://www.upn.gov.sk'.freeze | |
url = "#{BASE}/utvary-stb-a-ps-na-slovensku/zoznam-osob.php?pismeno=".freeze | |
agents = [] | |
# Separate page for each letter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package semaphore | |
import "sync" | |
type Semaphore struct { | |
Channel chan uint | |
Mutex sync.Mutex | |
} | |
func New(size uint) *Semaphore { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# gifcast - easily create gif screencasts from a selected area | |
# | |
# The first run lets you select a rectangle and starts recording while the second run stops the recording. | |
# Tested on Fedora 24 with GNOME | |
# Dependencies: xrectsel, byzanz, convert (ImageMagick) | |
FILE="/run/user/${UID}/$(basename $0).pid" |
NewerOlder