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
# | |
# Nate Theme | |
# a riff of Cobalt2 Theme - https://github.com/wesbos/Cobalt2-iterm | |
# Changes: doesn't use background colors or require powerline fonts | |
# Tested on Mac OS only | |
# I'm using with Operator Mono SSm font and Misterioso iTerm color presets | |
# | |
## | |
### Segment drawing | |
# A few utility functions to make it easy and re-usable to draw segmented prompts |
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
import React from "react"; | |
import { NextPageContext } from "next"; | |
const blogPostsRssXml = (blogPosts: IBlogPost[]) => { | |
let latestPostDate: string = ""; | |
let rssItemsXml = ""; | |
blogPosts.forEach(post => { | |
const postDate = Date.parse(post.createdAt); | |
if (!latestPostDate || postDate > Date.parse(latestPostDate)) { | |
latestPostDate = post.createdAt; |
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 pushme { | |
br=`git branch | grep "*"` | |
git add --all | |
if (($# > 1)); then | |
params='' | |
for i in $*; | |
do |
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
Route::post('auth/login', function(Request $request) { | |
$cred = $request->only('email', 'password'); | |
if (auth()->attempt($cred)) { | |
auth()->user()->tokens()->delete(); | |
$token = auth()->user()->createToken('SPA'); | |
return response()->json([ | |
'access_token' => $token->accessToken, |
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
// dashboard component | |
var dashboard = Vue.extend({ | |
template: '<p>Hello from dashboard</p>' | |
}) | |
// user management component | |
var user = Vue.extend({ | |
template: '<p>Hello from user management page</p>' | |
}) |
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 the code below to your theme's functions.php file to add a confirm password field on the register form under My Accounts. | |
add_filter('woocommerce_registration_errors', 'registration_errors_validation', 10,3); | |
function registration_errors_validation($reg_errors, $sanitized_user_login, $user_email) { | |
global $woocommerce; | |
extract( $_POST ); | |
if ( strcmp( $password, $password2 ) !== 0 ) { | |
return new WP_Error( 'registration-error', __( 'Passwords do not match.', 'woocommerce' ) ); | |
} |