Ctrl+KB | toggle side bar |
Ctrl+Shift+P | command palette |
Ctrl+` | python console |
Ctrl+N | new file |
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
<span style="position:relative;"> | |
<input type="text" disabled /> | |
<div style="position:absolute; left:0; right:0; top:0; bottom:0; cursor: pointer;" ></div> | |
</span> | |
<script> | |
$("span > div").click(function (evt) { | |
$(this).hide().prev("input[disabled]").prop("disabled", false).focus(); | |
}); | |
</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
AF : Afghanistan | |
AL : Albania | |
DZ : Algeria | |
AS : Samoa American | |
AD : Andorra | |
AG : Antigua & Barbuda | |
AI : Anguilla | |
AR : Argentina | |
AA : Armenia | |
AW : Aruba |
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( 'login_head', 'hide_login_nav' ); | |
function hide_login_nav() | |
{ | |
?><style>#backtoblog{display:none}</style><?php | |
} | |
/** | |
* remove the register link from the wp-login.php script |
Since this is on Hacker News...
- No, I don't distribute my résumé like this. A friend of mine made a joke about me being the kind of person who would do this, so I did (the link on that page was added later).
- I apologize for the use of
_t
in my types. I spend a lot of time at a level where I can do that; "reserved for system libraries? I am the system libraries". - They're all
while
loops because shut up, you're overthinking a joke.
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 | |
/** | |
* Get Ip function | |
*/ | |
function get_current_user_ip() { | |
if (!empty($_SERVER['HTTP_CLIENT_IP'])) : | |
$ip = $_SERVER['HTTP_CLIENT_IP']; | |
elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) : | |
$ip = $_SERVER['HTTP_X_FORWARDED_FOR']; |
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 | |
/** | |
* Get Ip function | |
*/ | |
function get_current_user_ip() { | |
if (!empty($_SERVER['HTTP_CLIENT_IP'])) : | |
$ip = $_SERVER['HTTP_CLIENT_IP']; | |
elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) : | |
$ip = $_SERVER['HTTP_X_FORWARDED_FOR']; |
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 'id' attribute to Vimeo oEmbed HTML | |
*/ | |
function prefix_embed_oembed_html( $html, $url, $attr, $post_ID ) { | |
$fix = true; | |
$fix &= strpos( $html, 'youtube.com' ) !== false; // Embed code from Vimeo | |
$fix &= strpos( $html, ' id=' ) === false; // No ID attribute supplied by Vimeo | |
$fix &= isset( $attr['player_id'] ); // Player ID supplied |
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 | |
/** | |
* Comment Style Callback | |
*/ | |
function fuji_comment_callback($comment, $args, $depth) { | |
$GLOBALS['comment'] = $comment; | |
extract($args, EXTR_SKIP); | |
if ( 'div' == $args['style'] ) { | |
$tag = 'div'; |
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 | |
function my_login_redirect( $redirect_to, $request, $user ) { | |
//is there a user to check? | |
global $user; | |
if ( isset( $user->roles ) && is_array( $user->roles ) ) { | |
//check for admins | |
if ( in_array( 'administrator', $user->roles ) ) { | |
// redirect them to the default place | |
return $redirect_to; | |
} else { |