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
webView.loadUrl( | |
"javascript:"+ | |
"var script = document.createElement('script'); "+ | |
"script.type = 'text/javascript'; "+ | |
"script.src = 'http://XXXXXXXXX:XXXX/target/target-script-min.js#anonymous'; "+ | |
"document.getElementsByTagName('head')[0].appendChild(script); " | |
); |
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
buildNumber=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "$INFOPLIST_FILE") | |
buildNumber=$(($buildNumber + 1)) | |
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "$INFOPLIST_FILE" |
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
# folder vars | |
FOLDERNAME=${PROJECT_NAME} | |
LIBRARYNAME="lib${PROJECT_NAME}.a" | |
OUTPUTFOLDER=${SRCROOT}/build/${FOLDERNAME} | |
# make sure the output directory exists | |
mkdir -p "${OUTPUTFOLDER}" | |
# device / simulator builds | |
xcodebuild -project "${PROJECT_NAME}.xcodeproj" -configuration "Release" -sdk "iphoneos7.1" clean build ARCHS="armv7 armv7s" IPHONEOS_DEPLOYMENT_TARGET="5.0" TARGET_BUILD_DIR="${BUILD_DIR}/build-arm" BUILT_PRODUCTS_DIR="${BUILD_DIR}/build-arm" |
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
module ActsAsCsv | |
class CsvRow | |
attr_accessor :header, :content | |
def initialize header,content | |
@header = header | |
@content = content | |
end |
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
f = File.open("moon_wiki.txt") | |
f.each do |line| | |
if (line.grep(/moon/i).length > 0) | |
puts "Match on line #{f.lineno} - #{line}" | |
end | |
end |
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
# update the tree initialiser to accept a nested structure with hashes and arrays | |
class Tree | |
attr_accessor :children, :node_name | |
def initialize(tree) | |
@node_name = tree.keys()[0] | |
@children = [] | |
tree[tree.keys()[0]].each do |k,v| |
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
# using each | |
values = [] | |
[*(1..16)].each do |i| | |
values.push(i) | |
if (values.length == 4) | |
puts values.join(",") | |
values = [] | |
end |
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
n = rand(100) | |
input = gets.chomp.to_i | |
while (input != n) do | |
puts (input < n) ? "Too low" : "Too high" | |
input = gets.chomp.to_i | |
end | |
puts "Correct! The answer was #{n}" |
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
10.times do |idx| | |
puts "This is the sentence number #{idx+1}" | |
end |
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
10.times do | |
puts "janusz" | |
end |
NewerOlder