One line summary (< 50c)
Longer description (wrap at 72c)
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
| <?php | |
| // load the image you want to crop | |
| $image = imagecreatefrompng('sample.png'); | |
| $width = imagesx($image); | |
| $height = imagesy($image); | |
| // create masking | |
| $mask = imagecreatetruecolor($width, $height); | |
| $transparent = imagecolorallocate($mask, 255, 0, 0); |
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
| #Newbie programmer | |
| def factorial(x): | |
| if x == 0: | |
| return 1 | |
| else: | |
| return x * factorial(x - 1) | |
| print factorial(6) | |
| #First year programmer, studied Pascal |
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
| #!/usr/bin/env python | |
| # | |
| # Copyright 2010 Facebook | |
| # | |
| # 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 | |
| # |
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
| /** | |
| * A {@link HttpRequest.ConnectionFactory connection factory} which uses OkHttp. | |
| * <p/> | |
| * Call {@link HttpRequest#setConnectionFactory(HttpRequest.ConnectionFactory)} with an instance of | |
| * this class to enable. | |
| */ | |
| public class OkConnectionFactory implements HttpRequest.ConnectionFactory { | |
| private final OkHttpClient client; | |
| public OkConnectionFactory() { |
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
| cd ~ | |
| sudo apt-get update | |
| sudo apt-get install openjdk-7-jre-headless -y | |
| ### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch and replace wget link below | |
| # NEW WAY / EASY WAY | |
| wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.90.0.deb | |
| sudo dpkg -i elasticsearch-0.90.0.deb |
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
| #!/bin/sh | |
| apt-get update | |
| apt-get update -y safe-upgrade | |
| apt-get install -y build-essential | |
| apt-get install -y python-dev python-setuptools | |
| easy_install pip | |
| echo "deb http://www.rabbitmq.com/debian/ testing main" > /etc/apt/sources.list.d/rabbitmq.list | |
| wget http://www.rabbitmq.com/rabbitmq-signing-key-public.asc |
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
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| """ | |
| pip install networkx distance pattern | |
| In Flipboard's article[1], they kindly divulge their interpretation | |
| of the summarization technique called LexRank[2]. |
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
| cd ~ | |
| ##If you want to install OpenJDK | |
| #sudo apt-get update | |
| #sudo apt-get install openjdk-8-jre-headless -y | |
| ###Or if you want to install Oracle JDK, which seems to have slightly better performance | |
| sudo add-apt-repository ppa:webupd8team/java | |
| sudo apt-get update | |
| sudo apt-get install oracle-java8-installer |