View main.js
This file contains 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 { render } from 'react-dom' | |
import { BrowserRouter, Route, Link } from 'react-router-dom' | |
import { TransitionGroup, Transition } from 'react-transition-group' | |
import matchPath from 'react-router-dom/matchPath' | |
const routes = [{ | |
key : 'home', | |
path : '/', | |
content : 'Homepage', |
View vsftpd.conf
This file contains 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
### | |
# VSFTPD.CONF for virtual users with write/read/delete permissions | |
### | |
anonymous_enable=NO | |
local_enable=YES | |
write_enable=YES | |
local_umask=022 | |
xferlog_enable=YES | |
connect_from_port_20=YES | |
chown_uploads=YES |
View Add Custom CSS to Anchors links in WordPress
This file contains 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
// Original Source : http://www.elftronix.com/add-css-class-directly-to-wordpress-menu-item-link/ | |
// This is modified version of code from elftronix.com | |
// -1 will add custom CSS class to every menu item, while if you will use 1 ut will add Custom css classs to 1st link only. | |
// normally WordPress themes apply CSS classes to UL and li not a links, that's why you can use this code to add class to anchors. | |
// i used this code to apply .mdl-navigation__link class from Material Design Framework to anchors, when i was creating WordPress theme with material design. | |
//Step 1 : Add this to register functions.php navigation menu |
View react-router-state-manager.jsx
This file contains 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
// note - this was my rough working prototype, but still left some artifacts in the query params. | |
// todo: also need to debounce the history pushes | |
// see comments for production Gatsby and Svelte versions which delete nondefault keys in the query params | |
import React from 'react' | |
import queryString from "query-string" | |
export const connectRouterState = defaultURLState => Component => props => { | |
const { history, location } = props | |
// note: do not nest objects in URL state |
View function.js
This file contains 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 blobToDataURL(blob) { | |
return new Promise((fulfill, reject) => { | |
let reader = new FileReader(); | |
reader.onerror = reject; | |
reader.onload = (e) => fulfill(reader.result); | |
reader.readAsDataURL(blob); | |
}) | |
} |