Skip to content

Instantly share code, notes, and snippets.

Avatar

Dominik Hádl dominik-hadl

View GitHub Profile
@dominik-hadl
dominik-hadl / check-for-todo-fixme.sh
Created Feb 2, 2017
A script meant to be used as Xcode build phase to detect todo and fixme and output warnings and errors.
View check-for-todo-fixme.sh
TODO_PROJECT_NAME="YourProject"
if [ $CONFIGURATION = "Release" ]; then
TAGS="FIXME"
find "${SRCROOT}/${TODO_PROJECT_NAME}" \( -name "*.swift" \) -print0 | xargs -0 egrep --with-filename --line-number --only-matching "($TAGS).*\$" | perl -p -e "s/($TAGS)/ error: \$1/"
TAGS="TODO"
find "${SRCROOT}/${TODO_PROJECT_NAME}" \( -name "*.swift" \) -print0 | xargs -0 egrep --with-filename --line-number --only-matching "($TAGS).*\$" | perl -p -e "s/($TAGS)/ warning: \$1/"
else
TAGS="FIXME|TODO"
find "${SRCROOT}/${TODO_PROJECT_NAME}" \( -name "*.swift" \) -print0 | xargs -0 egrep --with-filename --line-number --only-matching "($TAGS).*\$" | perl -p -e "s/($TAGS)/ warning: \$1/"
fi
@dominik-hadl
dominik-hadl / carthage_cache.rb
Created Aug 11, 2016
Caches build carthage files, for faster bootstrapping.
View carthage_cache.rb
#!/usr/bin/env ruby
require "fileutils"
require 'digest'
require 'optparse'
require 'xcodeproject'
# Constants
COMPILER_VER = /(?<=\()(.*)(?= )/.match(`xcrun swift -version`)[0]
CARTHAGE_RESOLVED_FILE="Cartfile.resolved"
View quiz7.java
retakeBtn.setOnClickListener(View.OnClickListener() {
@Override
public void onClick(View view) {
retakeBtn.setVisibility(View.GONE);
}
});
View quiz3.py
points = int(input("Enter desired points: "))
if points > 1000 or points < 0:
if points > 1000:
print("Does fairplay mean something to you at all?")
else:
print("What was that supposed to mean? You want minus points or what?")
else if points == 300:
print("Here is " + str(300) + " points.")
else:
View quiz8.pas
Program NodesQuiz_Question8;
Var
Points : Integer;
YourName : String;
Begin {NodesQuiz_Question7}
Writeln('Welcome to another test question!');
Writeln('What is your name?');
Readln(YourName);
Write('Hey ', YourName);
View quiz5.cs
class Quiz {
private static int pointsValue = 500;
void PrintPointsValue() {
Console.WriteLine("This quiz question is worth " + pointsValue);
}
}
Quiz q = new Quiz();
q.PrintPointsValue();
View quiz10.bas
10 PRINT "WELCOME TO NODES QUIZ"
20 PRINT "THIS IS A PROGRAM IN BASIC"
30 INPUT "CAN YOU FIGURE OUT WHAT IS WRONG HERE?"; A$
40 IF LEN(A$) = 0 THEN GOTO 30
50 A$ = LEFT$(A$, 1)
60 IF A$ = "Y" || A$ = "y" THEN GOTO 80
70 GOTO 30
80 PRINT "NICE CATCH!"
90 END
View quiz6
#!/usr/bin/env ruby
def say(text)
"Nodes " + text
end
put say 'Tech Quiz'
@dominik-hadl
dominik-hadl / BinaryConvertor.pas
Created Nov 8, 2014
Converts a decimal number in a string to binary (from input file CISLA.IN to output file CISLA.OUT, one number on each line).
View BinaryConvertor.pas
program BinaryConvertor;
{ ----------------------------------------------------------- }
uses
Sysutils;
{ ----------------------------------------------------------- }
{ DIVIDE BY TWO }
@dominik-hadl
dominik-hadl / Pascal.sublime-build
Created Oct 2, 2014
A sublime build system for Free Pascal, also with option to open & run in iTerm app when Cmd+Shift+B pressed, otherwise just normally compiles with fpc.
View Pascal.sublime-build
{
"shell_cmd": "fpc \"${file}\" -o\"${file_path}/${file_base_name}\"",
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"working_dir": "${file_path}",
"selector": "source.pascal",
"variants":
[
{
"name": "Run",
"shell_cmd": "fpc \"${file}\" -o\"${file_path}/${file_base_name}\" && open -a iTerm.app \"${file_path}/${file_base_name}\"",
You can’t perform that action at this time.