This file contains hidden or 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
| apt-get update | |
| apt-get install -y \ | |
| git \ | |
| autoconf \ | |
| build-essential \ | |
| language-pack-en \ | |
| libarchive-dev \ | |
| libblas-dev \ | |
| libboost-all-dev \ |
This file contains hidden or 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 packages: sudo apt-get update | |
| Install the following packages: apt-get install git build-essential autoconf libtool php5-curl libbison-dev libxml2-dev libssl-dev openssl | |
| Check that your OpenSSL version is now at least 1.0.1 by running: openssl version | |
| Get the libcurl sources, compile, and install: | |
| git clone https://github.com/curl/curl.git | |
| cd curl |
This file contains hidden or 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
| # Sync the S3 buckets with public read ACL | |
| aws s3 sync s3://source_bucket s3://target_bucket --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers | |
| aws login |
This file contains hidden or 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
| # Makes a backup of the heroku database | |
| heroku pg:backups capture --app myapp | |
| # Downloads the backup of the heroku database | |
| curl -o latest.dump `heroku pg:backups public-url --app myapp` | |
| # imports the Heroku postgres database into your local machine's database | |
| /Applications/Postgres.app/Contents/Versions/latest/bin/pg_restore --verbose --clean --no-acl --no-owner -h localhost -U rdegraci -d dev_local_database latest.dump |
This file contains hidden or 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_eval | |
| class_eval | |
| module_eval mod.module_eval( aString ) -> anObject | |
| mod.module_eval {| | block } -> anObject | |
| Evaluates the string or block in the context of mod. This can be used to add methods to a class. module_eval returns the result of evaluating its argument. | |
| class Thing | |
| end | |
| a = %q{def hello() "Hello there!" end} | |
| Thing.module_eval(a) » nil |
This file contains hidden or 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
| To see a visual diff of all differences between two branches I like to merge the two branches WITHOUT commiting the merge, and then use Git Gui or Git Extensions to get an overview of the differences. | |
| Git command line for merging without commiting: | |
| git checkout branchA | |
| git merge --no-commit --no-ff branchB | |
| shareedit | |
| answered May 28 '13 at 11:29 | |
| Tormod Hystad |
This file contains hidden or 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
| @interface ManagedObjectCloner : NSObject { | |
| } | |
| +(NSManagedObject *)clone:(NSManagedObject *)source inContext:(NSManagedObjectContext *)context; | |
| @end | |
| @implementation ManagedObjectCloner | |
| +(NSManagedObject *) clone:(NSManagedObject *)source inContext:(NSManagedObjectContext *)context{ |
This file contains hidden or 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
| # install java 8 | |
| sudo add-apt-repository -y ppa:webupd8team/java | |
| sudo apt-get update | |
| sudo apt-get -y install oracle-java8-installer | |
| java -version | |
| # install elasticsearch | |
| wget https://download.elastic.co/elasticsearch/release/org/elasticsearch/distribution/deb/elasticsearch/2.3.5/elasticsearch-2.3.5.deb | |
| sudo dpkg -i elasticsearch-2.3.5.deb | |
| sudo update-rc.d elasticsearch defaults |
This file contains hidden or 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
| train_set = [ # A AND NOT B | |
| [0,0,0], | |
| [0,1,0], | |
| [1,0,1], | |
| [1,1,0], | |
| ] | |
| n=30 | |
| layers = [2, 2, 1] |
This file contains hidden or 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
| -- | |
| -- Rodney Degracia | |
| -- | |
| -- July 2014 | |
| -- | |
| -- Script to find the frequency of books published each year | |
| -- | |
| -- http://www2.informatik.uni-freiburg.de/~cziegler/BX/ | |
| -- | |
| -- |
NewerOlder