See how a minor change to your commit message style can make you a better programmer.
Format: <type>(<scope>): <subject>
<scope> is optional
| // first of all make sure we have enough arguments (exit if not) | |
| if (process.argv.length != 5) | |
| { | |
| console.error("Usage: node csv2html.js input.csv template.ejs output.html") | |
| console.error(); | |
| console.error("Outputs the given template for each row in the given input.") | |
| console.error("Uses the first row of the CSV as column names in the template.") | |
| process.exit(1); | |
| } |
| <?php | |
| //* Do NOT include the opening php tag | |
| //* Load Lato and Merriweather Google fonts | |
| add_action( 'wp_enqueue_scripts', 'bg_load_google_fonts' ); | |
| function bg_load_google_fonts() { | |
| wp_enqueue_style( 'google-fonts', '//fonts.googleapis.com/css?family=Lato:300,700|Merriweather:300,700', array(), CHILD_THEME_VERSION ); | |
| } |
| ## | |
| ### Redirects via .htaccess | |
| ## 301: Moved PERMANENTLY | |
| ## 302: Moved TEMPORARILY | |
| #Redirect an entire site: | |
| Redirect 301 / http://www.domain.com/ | |
| # Basic: Redirect all |
| # .gitignore | |
| # *** HOUSEKEEPING! Ignorance is bliss *** | |
| # Master File: Maintained by Primitive Digital's Housekeeping Department | |
| # https://primitivedigital.uk/housekeeping-department/ | |
| # Always-ignore these extensions | |
| *.diff | |
| *.err | |
| *.orig | |
| *.log |
| // Custom JavaScript Performance Testing Script | |
| // *** HOUSEKEEPING! Performance Review *** | |
| // Master File: Maintained by Primitive Digital's Housekeeping Department | |
| // https://primitivedigital.uk/housekeeping-department/ | |
| // This utilises the native | |
| // https://developer.mozilla.org/en-US/docs/Web/API/Performance | |
| // This can be saved to an external JS file and placed in the library | |
| // this will allow the performance tests to be toggled on/off based on a fied value |
| const filter = (fn, arr) => arr.reduce((newArr, item) => { | |
| return fn(item) ? newArr.concat([item]) : newArr; | |
| }, []); |
| import speculation from 'speculation'; | |
| const wait = ( | |
| time, | |
| cancel = Promise.reject() // By default, don't cancel | |
| ) => speculation((resolve, reject, onCancel) => { | |
| const timer = setTimeout(resolve, time); | |
| // Use onCancel to clean up any lingering resources | |
| // and then call reject(). You can pass a custom reason. |
| // HOF Wraps the native Promise API | |
| // to add take a shouldCancel promise and add | |
| // an onCancel() callback. | |
| const speculation = ( | |
| fn, | |
| cancel = Promise.reject() // Don't cancel by default | |
| ) => new Promise((resolve, reject) => { | |
| const noop = () => {}; | |
| const onCancel = ( |
| const wait = time => new Promise( | |
| res => setTimeout(() => res(), time) | |
| ); | |
| wait(200) | |
| // onFulfilled() can return a new promise, `x` | |
| .then(() => new Promise(res => res('foo'))) | |
| // the next promise will assume the state of `x` | |
| .then(a => a) | |
| // Above we returned the unwrapped value of `x` |