Skip to content

Instantly share code, notes, and snippets.

View trebi's full-sized avatar

Richard Trebichavský trebi

  • Bratislava, Slovakia
View GitHub Profile
@trebi
trebi / valet-switch
Last active February 14, 2021 12:30
"Switch" valet between multiple users
#!/usr/bin/env bash
valet install
USER=$(whoami)
echo "Updating configuration for user '$USER'"
STR='Users\/[a-zA-Z0-9]*\/'
REPLACE="Users\/$USER\/"
REGEX="s/$STR/$REPLACE/g"

Conference brochure app

Imagine you arrive to conference. You immediately get the brochure with timeline of all talks/workshops, venue map/plan etc. You use it to orientate in the event - you read the descriptions of all talks and the informaiton about the speakers to build you own timeline. This app should work as an venue brochure, which could receive updates, but could be accessible offline as well.

The app is meant to be universal across events - when you arrive to the event, you already have installed the app you are familiar with in your phone. You just scan QR code (+ optionally authenticate yourself) to load the data about current conference.

Some apps to get inspiration from: http://blog.venturepact.com/17-best-mobile-event-apps-for-conferences-and-corporate-events/

Minimal feature set

  • User
@trebi
trebi / 1st-milestone-group-6.md
Last active November 6, 2016 18:13
1st Milestone Evaluation - Creatures hunting, group 6

1st Milestone Evaluation

  • Review author: Richard Trebichavský (410115)
  • Project: Creatures hunting, group 6
  • Team leader: Bc. Marek Turis (422805)

Project Requirements

  • create a project in a Github repository that is publicly accessible (for read) choose a short and descriptive name. Create some project wiki to publish other information for your project.
  • on the project wiki there will be a project description, a use case diagram and a class diagram for entity classes.

Oops! I accidentally deleted a local git branch, and I haven't pushed it to a remote server yet. The branch has several important commits, and it hasn't been merged with any other branches yet. How do I find the missing branch?

1. Create a list of all dangling or unreachable commits.

$ git fsck --full --no-reflogs --unreachable --lost-found
unreachable tree 4a407b1b09e0d8a16be70aa1547332432a698e18
unreachable tree 5040d8cf08c78119e66b9a3f8c4b61a240229259
unreachable tree 60c0ce61b040f5e604850f747f525e88043dae12
unreachable tree f080522d06b9853a2f18eeeb898724da4af7aed9
@trebi
trebi / sort_print_page_ranges.php
Last active August 29, 2015 13:56
Expand and sort print page ranges
$in = "498,500-504,540,542-546,592,594-598,650-654,658,698,700-704,758,810,54-70";
$r = explode(",", $in );
$r2 = $r;
foreach ($r2 as $k => $v) {
if (strpos($v, "-") !== false) {
//var_dump($v);
$ab = explode("-", $v);
$r[$k] = $ab[0];
for ($i = $ab[0]+1; $i <= $ab[1]; $i++) {
@trebi
trebi / muni_quiz_check
Created January 17, 2014 14:46
Answer again already answered quizzes in is.muni.cz
javascript: (function(){
document._ans=new Array();
$('table[bgcolor="#CCCC66"] *').hide();
$('table[bgcolor="#CCCC66"]').css({
'border-bottom':'3px ridge','margin':'2px'
});
$("form>p").hide();
$("table[cellspacing='0'] tr").each(
function(i,b){
@trebi
trebi / Compile GIT on FreeBSD
Last active December 23, 2015 08:29
How to compile GIT on FreeBSD shared host
===============================
SERVER (COMPILE AND SET UP GIT)
===============================
1) Obtain 'gmake' binary and extract, since FreeBSD uses 'pmake'
curl -O ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-8.4-release/All/gmake-3.82_1.tbz
tar xjf ../gmake-3.82_1.tbz
2) Obtain 'git' sources and extract
...