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 'active_record' | |
require 'net/ssh/gateway' | |
class CombinedHCP < ActiveRecord::Base | |
self.table_name = 'schema.tablename' | |
self.primary_key = 'uuid' | |
end | |
# set password nil to use public key authentication | |
# as an alternative to using the local ~/.ssh/config, you can also supply all host parameters directly |
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
source 'https://rubygems.org' | |
git_source(:github) { |repo| "https://github.com/#{repo}.git" } | |
ruby '2.5.7' | |
gem 'activerecord' | |
gem 'net-ssh-gateway' |
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
# frozen_string_literal: true | |
# 1. Manage your Slack apps at https://your_slack_team_name.slack.com/apps/manage | |
# 2. Create an 'Incoming WebHooks' configuration | |
require 'net/http' | |
require 'json' | |
class Slack | |
def self.post(text, channel = '#channel', username = 'default username') |
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
Dir['./books/*/*/*.jpeg'].each do |file_path| | |
next if File.directory? file_path | |
file_name = file_path.sub('.jpeg', '.uzn') | |
puts "OCR #{file_name}" | |
uzn_content = """2385 1059 273 201 Energie | |
2634 1080 372 210 Kohlenhydrate | |
2961 1062 294 234 Fett | |
3204 1080 321 186 Eiweiss | |
2030 1500 800 960 Zutaten |
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 | |
cd / | |
umount /sys/firmware/efi/efivars/ | |
mount -t efivarfs rw /sys/firmware/efi/efivars/ | |
cd /sys/firmware/efi/efivars/ | |
chattr -i "gpu-power-prefs-*" | |
rm gpu-power-prefs-* | |
printf "\x07\x00\x00\x00\x01\x00\x00\x00" > /sys/firmware/efi/efivars/gpu-power-prefs-fa4ce28d-b62f-4c99-9cc3-6815686e30f9 |
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
{ | |
"servers": [ | |
{ | |
"host": "myapplication.com", | |
"username": "ubuntu", | |
"pem": "~/.ssh/keypair.pem" | |
} | |
], | |
"setupMongo": true, | |
"setupNode": true, |
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
Process: GitX [53299] | |
Path: /Applications/GitX.app/Contents/MacOS/GitX | |
Identifier: nl.frim.GitX | |
Version: 0.8.4 (0.8.4) | |
Code Type: X86-64 (Native) | |
Parent Process: launchd [314] | |
User ID: 502 | |
Date/Time: 2012-03-21 15:27:23.377 +0100 | |
OS Version: Mac OS X 10.8 (12A128p) |
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
/////////////////////////////////////// | |
// Categories - Exercises | |
NSArray *categoriesMap = [NSArray arrayWithObjects:@"uid", @"text_de", @"text_en", nil]; | |
RKManagedObjectMapping *exerciseLevelMapping = [RKManagedObjectMapping mappingForClass:[ExerciseLevel class]]; |
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
/** | |
* Return an array with objects found in the local database for the given predicate. | |
*/ | |
-(NSArray *)fetchEntity:(NSString *)entityName withPredicateFormat:(NSString *)format, ... { | |
NSManagedObjectContext *managedObjectContext = [RKObjectManager sharedManager].objectStore.managedObjectContext; | |
NSFetchRequest *request = [[NSFetchRequest alloc] init]; | |
NSEntityDescription *entity = [NSEntityDescription entityForName:entityName | |
inManagedObjectContext:managedObjectContext]; |
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
git=`which git` | |
gittag=`git describe --abbrev=0 --tags` #`$git describe --tags --always` | |
gitcount=`$git rev-list --all | wc -l | tr -cd '[[:digit:]]'` |
NewerOlder