Skip to content

Instantly share code, notes, and snippets.

@lolgear
lolgear / git_single_file_revision_search.sh
Created November 23, 2016 15:44
Search Podfile.lock for specific pod commit updates.
# $file = path to file;
# $name = ( name to search (actually, it is a regex) )
# EncryptedCoreData:
# - :commit: 5044489e622143d6efdb69fbbc383748618b5fe4
# + :commit: 4ca0977e9e0b610e6813886276bb7bbd9406335f
#
#
# Pod revision.
git log -p -- FILE | perl -lne '$name = 'PODNAM'; (/^\s+$name[\w-]*:\s*$/ .. /^\+\s+:commit:/) and print'
@lolgear
lolgear / project_find_and_link.pl
Created September 9, 2016 12:46
when you have too many xcworkspaces in your project, you could gather them in a directory and put it in dock
ls ./AppIcon.appiconset/*.png | perl -MFile::Basename -ne 'chomp; ($b, $d, $f) = fileparse($_, qr/\.[^.]*/); $s = qx(convert -channel G -separate ${_} ./AppIconPublicBeta.appiconset/${b}.png); print "$s"; print "\n";'
http://www.imagemagick.org/Usage/color_basics/#separate
class A
def relativePath(path)
self.relativePath(path,self.path)
end
def self.relativePath(path,to_path)
Pathname.new(path).relative_path_from(Pathname.new(to_path))
end
end
class A
def needToCallAsInstanceAndClass# or no arguments
self.class.needToCallAsInstanceAndClass(self.getArgs)
end
def self.needToCallAsInstanceAndClass(*args)
# wowowow
# implementation here
end
end
# gem 'xcodeproj'
# native_target.rb
# @return [String] the name of the build product.
#
attribute :product_name, String
class A
cattr_reader(
:dictionary
)
@@dictionary = {}
end
class B < A
attr_accessor(
:path,
:name
)
def initialize(path,name)
self.path = path
if name
@name = name
end
Project/Helpers/Helpers.rb
Component/ComponentModule.rb
Component/ComponentParts/FirstPart.rb
Component/ComponentParts/SecondPart.rb
# how to solve dependency: SecondPart.rb use Helpers.rb ( module NecessaryHelp ) ?)
self.images =
images
.select{
|image|
image.kind_of?(ImageClass)
}
.map{
|image|
self.generate_image_object_from_image
}