I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!
\
require 'formula' | |
class Opencv < Formula | |
homepage 'http://opencv.org/' | |
url 'https://github.com/mkassner/opencv/archive/2.4.8.2.tar.gz' | |
sha1 '5a23ad0c587d6a7fe00d79dfdea0199d7c584923' | |
option '32-bit' | |
option 'with-qt', 'Build the Qt4 backend to HighGUI' | |
option 'with-tbb', 'Enable parallel code in OpenCV using Intel TBB' |
# Create a method 'search_methods' for the Object Class | |
class Object | |
def search_methods(qry) | |
self.methods & self.methods.select { |m| m.to_s.include? qry.to_s } | |
end | |
end | |
# Now search methods for any Ruby Object | |
Array.search_methods 'enum' # => [:to_enum, :enum_for] | |
Player.last.search_methods :trust # => [:untrust, :untrusted?, :trust] |
When hosting our web applications, we often have one public IP
address (i.e., an IP address visible to the outside world)
using which we want to host multiple web apps. For example, one
may wants to host three different web apps respectively for
example1.com
, example2.com
, and example1.com/images
on
the same machine using a single IP address.
How can we do that? Well, the good news is Internet browsers
#!/bin/bash | |
MONGO_DATABASE="your_db_name" | |
APP_NAME="your_app_name" | |
MONGO_HOST="127.0.0.1" | |
MONGO_PORT="27017" | |
TIMESTAMP=`date +%F-%H%M` | |
MONGODUMP_PATH="/usr/bin/mongodump" | |
BACKUPS_DIR="/home/username/backups/$APP_NAME" |
You can use this class to realize a simple sectioned RecyclerView.Adapter
without changing your code.
The RecyclerView
should use a LinearLayoutManager
.
You can use this code also with the TwoWayView
with the ListLayoutManager
(https://github.com/lucasr/twoway-view)
This is a porting of the class SimpleSectionedListAdapter
provided by Google
Example:
# Clear existing task so we can replace it rather than "add" to it. | |
Rake::Task["deploy:compile_assets"].clear | |
namespace :deploy do | |
desc 'Compile assets' | |
task :compile_assets => [:set_rails_env] do | |
# invoke 'deploy:assets:precompile' | |
invoke 'deploy:assets:precompile_local' | |
invoke 'deploy:assets:backup_manifest' |
@binkmail.com | |
@bobmail.info | |
@chammy.info | |
@devnullmail.com | |
@letthemeatspam.com | |
@mailinater.com | |
@mailinator.net | |
@mailinator2.com | |
@notmailinator.com | |
@reallymymail.com |
/* | |
* Copyright 2014 Chris Banes | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
// The Very Basic | |
new AsyncTask<Void, Void, Void>() { | |
protected void onPreExecute() { | |
// Pre Code | |
} | |
protected Void doInBackground(Void... unused) { | |
// Background Code | |
return null; | |
} | |
protected void onPostExecute(Void unused) { |