momolog.info
MoMolog » AWS
http://momolog.info/category/aws
Copying Files between S3 buckets. Juli 8, 2010 at 12:27 pm · Filed under AWS. Building on this article. Here is a simple ruby script, that copies files between two buckets of the same S3 account, omitting files already present (by name). This variant adds a list of path prefixes, so you can selectively copy only certain directories of your buckets. Furthermore it copies the original buckets ACLs for each key. MoMolog aus Berlin stellt sich vor. Projekte, Ideen, Referenzen. Globuli – Musik aus Berlin.
momolog.info
MoMolog » Connecting to redis via SSH tunneling
http://momolog.info/2011/12/02/connect-to-redis-via-ssh-tunneling
Connecting to redis via SSH tunneling. Dezember 2, 2011 at 12:46 pm · Filed under Allgemein. SSH tunneling is, of course, useful for a ton of services, but I happened to stumble upon it, when I wanted to connect to a remote redis server. If you have a redis server running on [remotehost], you can easily connect. To it (given you have ssh access to it, of course) via:. Ssh -L 9999:localhost:6379 [remoteuser]@[remotehost]. Mai 24, 2012 @ 3:01 am. Juni 5, 2015 @ 4:27 pm. Feed for comments on this post.
momolog.info
MoMolog » Saving local text files to S3 using paperclip
http://momolog.info/2011/12/02/saving-local-text-files-to-s3-using-paperclip
Saving local text files to S3 using paperclip. Dezember 2, 2011 at 12:49 pm · Filed under Rails. Sometimes you need to save a locally created file to S3 instead of an uploaded file, as is the standard. Here is how:. Has attached file :tagged text file, STORAGE OPTIONS.merge({ :processors = [] }). Def save tagged text file. File = File.open(„#{RAILS ROOT}/tmp/tagged text #{id}.txt“, ‚w ‘). E-mail (required, not published! MoMolog aus Berlin stellt sich vor. Projekte, Ideen, Referenzen.
momolog.info
MoMolog » Ruby: map Array to Hash
http://momolog.info/2010/10/07/ruby-map-array-to-hash
Ruby: map Array to Hash. Oktober 7, 2010 at 8:49 am · Filed under Note to self. Sometimes you may wish to map an Array to a Hash in Ruby, like say, you got the output of I18n.available locales. Locales = [:en, :de, :fr]. And want to transform that into a Hash to fill a select element, like so:. En = 'EN', :de = 'DE', :fr = 'FR'}. How do you do that in the most concise way? First, there is always. Locales.inject({}) { hsh, sym hsh[sym] = sym.to s.upcase; hsh}. Hash[ [:a,:b],[:c,:d] ]. Hash[:a,:b,:c,:d].
momolog.info
MoMolog » Use CSS to change link content on hover
http://momolog.info/2014/02/18/use-css-to-change-link-content-on-hover
Use CSS to change link content on hover. Februar 18, 2014 at 2:29 pm · Filed under Allgemein. Using just a data-attribute and a simple stylesheet rule it is possible to change the content of a link when hovering over it. Use an HTML / SASS combination like the following:. See this in action. E-mail (required, not published! MoMolog aus Berlin stellt sich vor. Projekte, Ideen, Referenzen. Globuli – Musik aus Berlin. Theater und Orchester GmbH. Psychotherapeutische Praxis Katharina Heldt-Erche.
momolog.info
MoMolog » Copying Files between S3 buckets
http://momolog.info/2010/07/08/copying-files-between-s3-buckets
Copying Files between S3 buckets. Juli 8, 2010 at 12:27 pm · Filed under AWS. Building on this article. Here is a simple ruby script, that copies files between two buckets of the same S3 account, omitting files already present (by name). This variant adds a list of path prefixes, so you can selectively copy only certain directories of your buckets. Furthermore it copies the original buckets ACLs for each key. E-mail (required, not published! Globuli – Musik aus Berlin. Theater und Orchester GmbH.
momolog.info
MoMolog
http://momolog.info/page/2
November 28, 2009 at 12:26 pm · Filed under Allgemein. Has become a de facto visualization standard for the presentation of collections of images, be it covers or portraits. There are a number of implementations for usage on web pages (e.g. this one. But the usable ones require Adobes Flash and thus won’t run on the iPhone. When looking for HTML5 canvas based implementations I found this promising implementation. Based on the YUI library. Here are two screenshots:. CoverFlow using canvas and jQuery.
momolog.info
MoMolog » Javascript
http://momolog.info/category/javascript
November 28, 2009 at 12:26 pm · Filed under Allgemein. Has become a de facto visualization standard for the presentation of collections of images, be it covers or portraits. There are a number of implementations for usage on web pages (e.g. this one. But the usable ones require Adobes Flash and thus won’t run on the iPhone. When looking for HTML5 canvas based implementations I found this promising implementation. Based on the YUI library. Here are two screenshots:. CoverFlow using canvas and jQuery.
momolog.info
MoMolog » Using throw and catch to tidy up our code
http://momolog.info/2012/03/29/using-throw-and-catch-in-controllers
Using throw and catch to tidy up our code. März 29, 2012 at 12:17 pm · Filed under Rails. Let’s say we want a simple controller action that checks, if a given code is valid. It should return true and false and, if the code is invalid, give the reason (whether that is because it is unknown or because it has been used already). The action could look like this:. Now this deep nesting effectively hides the underlying algorithm, a simple one in this case. Straightens the code a bit:. We are down to one.
momolog.info
MoMolog » Allgemein
http://momolog.info/category/allgemein
HTML5 input validation with custom message. September 29, 2014 at 11:45 am · Filed under Allgemein. HTML5 provides us with ways to specify different types of input, complete with client side validation. Inputs can be marked as. And it is even possible to specify regexp patterns. Let’s put this into action by creating an input for german zip codes, consisting of 5 numbers:. As you can see, this works, but the actual validation message you get when entering a wrong. Unfortunately there is no. Using just a ...