A Pen by Farhan Faruque on CodePen.
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
| <html> | |
| <head> | |
| </head> | |
| <body> | |
| <script async='async' src='https://www.googletagservices.com/tag/js/gpt.js'></script> | |
| <script> |
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
| package main | |
| import "fmt" | |
| func BinarySearch(arr [] int, x int) bool{ | |
| var lowerBound int = 0 | |
| var higherBound int = len(arr) - 1 | |
| for lowerBound <= higherBound { | |
| var midPoint = lowerBound + (higherBound - lowerBound) /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
| public static void addProductIdHeader(EditionService service, final String artId, HttpServletResponse response) { | |
| //1) has access to all editions always | |
| StringBuilder xpids = new StringBuilder("1"); | |
| boolean isD2 = service.isArticleAvailableToEdition(artId, EditionService.D2_EDITION, null); | |
| logger.debug("Article id:"+artId+" D2 edition:"+isD2); | |
| boolean isMag = service.isArticleAvailableToEdition(artId, EditionService.MAGAZINE_EDITION, null); | |
| logger.debug("Article id:"+artId+" Magazine edition:"+isMag); |
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
| public static void addProductIdHeader(HttpServletResponse response, String pidDate, | |
| String articleHomeSection, | |
| boolean isArticleAvailableToCurrentEd){ | |
| DateTime now; | |
| if(pidDate == null) { | |
| now = new DateTime(DateTimeZone.forID("CET")); | |
| } else { | |
| String[] fakeDate = pidDate.split("/"); | |
| now = new DateTime(Integer.valueOf(fakeDate[2]), | |
| Integer.valueOf(fakeDate[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
| You can do page up/down and home/end on a Macbook keyboard by using the fn and the arrow keys: | |
| fn+↑ is PageUp | |
| fn+↓ is PageDown | |
| fn+← is Home | |
| fn+→ is End | |
| Cmd + spacebar Top Search bar | |
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
| 1. Create a .desktop file | |
| Create a desktop launcher (or shortcut) for your application. | |
| touch rubymine.desktop | |
| For RubyMine, mine looks like this: | |
| [Desktop Entry] | |
| Version=1.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
| # copy jdk from downloads to /usr/local/java | |
| sudo cp -r jdk-7u45-linux-x64.tar.gz /usr/local/java | |
| # extract the folder | |
| sudo tar xvzf jdk-7u45-linux-x64.tar.gz | |
| #set home variable | |
| sudo nano ~/.bashrc | |
| JAVA_HOME=/usr/local/java/jdk1.7.0_45 | |
| JRE_HOME=$JAVA_HOME/jre |
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
| $("#profile_picture").change(function () { | |
| readURL(this); | |
| }); | |
| function readURL(input) { | |
| if (input.files && input.files[0]) { | |
| var reader = new FileReader(); | |
| reader.onload = function (e) { | |
| $('#image_preview') | |
| .attr('src', e.target.result) |
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
| if you make /var/www writeable by its group and add the user to the group, that user will not have to use sudo. Try this: | |
| sudo adduser <username> www-data | |
| sudo chown -R www-data:www-data /var/www | |
| sudo chmod -R g+rw /var/www | |
| The user should then be able to edit /var/www/ files without hassle. | |
| The first line adds the user to the www-data group, the second line clears up any files with messed up ownership, and the third makes it so that all users who are members of the www-data group can read and write all files in /var/www. | |
| If you are logged in as <username> you need to log out and log back in for the group membership to take effect. |