Skip to content

Instantly share code, notes, and snippets.

@mchandleraz
mchandleraz / page-cat63.php
Created June 15, 2013 14:59
Get WP Posts from Category 63
<?php $query = new WP_Query('cat=63');
while ($query->have_posts()) : $query->the_post();
$ico_cal = $woo_options[ 'woo_post_calendar' ] == "true";
$full_content = $woo_options[ 'woo_post_content' ] != "content";
?>
<div <?php post_class(); ?>>
node_modules/mongoose/node_modules/mongodb/lib/server.js:228
process.nextTick(function() { throw err; })
^
Error
at Object.<anonymous> (/Projects/node/flapper-news/node_modules/mongoose/node_modules/mongodb/node_modules/mongodb-core/lib/error.js:42:24)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
@mchandleraz
mchandleraz / app.js
Last active August 29, 2015 14:20
ngApp
var app = angular.module('flapperNews', ['ui.router']);
app.config([
'$stateProvider',
'$urlRouterProvider',
function($stateProvider, $urlRouterProvider) {
$stateProvider
.state('home', {
url: '/home',
# Nothing to see here — Everything's in .bash_profile
[ -n "$PS1" ] && source ~/.bash_profile
# export PATH=/usr/local/bin:/usr/local/sbin:$PATH
### Aliases
# Open specified files in Sublime Text
# "s ." will open the current directory in Sublime
alias s='open -a "Sublime Text"'
alias hova="s ."
# Color LS
<defs>
<filter id="f1" x="0" y="0" width="120%" height="120%">
<feOffset result="offOut" in="SourceAlpha" dx="0" dy="0" />
<feGaussianBlur result="blurOut" in="offOut" stdDeviation="5" />
<feBlend in="SourceGraphic" in2="blurOut" mode="normal" />
</filter>
</defs>
@mchandleraz
mchandleraz / tldr.md
Last active November 13, 2015 17:57
client-side dependency management within b2c-portal

Problem:

We want to be able to version and deploy our b2c-custom-elements individually/independently, to help make our deployments more scalable with less friction.

Solution(s):

  • git submodules
  • bower

summary: git submodules will allow us to have a much cleaner seperation between individual custom elements. Unfortunately, they also introduce a lot of complexity and overhead for developers. By leveraging a package manager like bower alongside a git workflow and architecture like the team discussed, we can have a scalable and maintainable dependency management system that allows us to deploy specific versions of our custom elements to the b2c-portal, independent of each other. Bower will require splitting our b2c-custom-elements repo into individual repos for each element, but the benefits far outweigh the amount of work this transition would require.

@mchandleraz
mchandleraz / wrapInTags.js
Last active February 21, 2017 00:57
Ruby vs JavaScript
let titleTag = wrapInTags('title', 'Hello');
Mailer.send(titleTag);
Page.create(titleTag);
function wrapInTags(tag, text) {
return `<${tag}>${text}</${tag}>`;
}
* `cache-clean` clears watchman and npm caches, removes all `react` directories from the system TMP directory, and resets the React Native JS Packager cache.
* `cache-flush` is `cache-clean` + removes all npm modules from disk and re-installs with yarn.
"cache-clean": "watchman watch-del-all && rm -rf $TMPDIR/haste-map-react-native-packager-* && rm -rf $TMPDIR/react-* && yarn start -- --reset-cache",
"cache-flush": "watchman watch-del-all && rm -rf $TMPDIR/haste-map-react-native-packager-* && rm -rf $TMPDIR/react-* && rm -rf node_modules/ && yarn cache clean && yarn && yarn start -- --reset-cache",