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
{ | |
"name": "generator-ionic-npm", | |
"version": "1.1.1", | |
"description": "Ionic app generator for yeoman using npm scripts as build tool", | |
"scripts": { | |
"scss": "node-sass --output-style compressed -o www/css src/scss", | |
"lint": "jshint src", | |
"concat": "node npm_scripts/concat.js", | |
"concat-vendor": "node npm_scripts/concat.vendor.js", | |
"uglify": "uglifyjs www/js/app.bundle.js -c -m -o www/js/app.bundle.min.js", |
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
describe('testing using $httpBackend in ionic app', function() { | |
var yourAsyncService; | |
var $httpBackend; | |
// prepare our service and $httpBackend | |
beforeEach(function() { | |
// load module that holds our service | |
// make sure the required module is loaded | |
module('module_name'); |
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
# including any dots | |
/^[^\w\d]+|-(?<!\w)+|[^\w\d\.-]+|\s+|_+|[^\w\d]+$/ | |
# match any dots except the last dot before tld | |
/^[^\w\d]+|-(?<!\w)+|\.(?!\w+$)|[^\w\d\.-]+|\s+|_+|[^\w\d]+$/ |
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 | |
// other stuff ... | |
// register our filter to the wordpress action 'the_content', | |
// it will then be called when we call the_content() from anywhere in our template | |
add_filter( 'the_content', 'add_classlist_to_img' ); | |
function add_classlist_to_img( $content ) { | |
// used to detect img tag element | |
$locateElement = '/\<img.*?\/\>/'; |
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 wc_get_categories() { | |
$all_categories = get_categories(array( | |
'taxonomy' => 'product_cat' | |
)); | |
foreach ($all_categories as &$cat) { | |
$thumbnail_id = get_woocommerce_term_meta( $cat->term_id, 'thumbnail_id', true ); | |
$cat->thumbnail_image = wp_get_attachment_url( $thumbnail_id ); | |
$cat->link = get_term_link( $cat->slug, 'product_cat' ); |
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
" NOTE: change 'input' with tag name | |
" this will insert '/' before closing the tag | |
" e.g <input type="text"> | |
" will become <input type="text"/> | |
%s/\(input.*\)\ze>/\1\/ |
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
.background { | |
background-color: #efefef; | |
} | |
.me { | |
background-color: tomato; | |
} | |
.ji { | |
background-color: orange; |
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
const filterWhitelist = ar => key => ar.includes(key) | |
const sliceState = (state, whitelist) => Object.keys(state) | |
.filter(filterWhitelist(whitelist)) | |
.reduce((sliced, key) => ({ ...sliced, [key]: state[key] }), {}) | |
// usage | |
const slicer = paths => state => { | |
const { ui, auth } = state |
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
# Colors (Nord) | |
# colors: | |
# # Default colors | |
# primary: | |
# background: '0x2E3440' | |
# foreground: '0xD8DEE9' | |
# | |
# # Normal colors | |
# normal: | |
# black: '0x3B4252' |
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
ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[green]%}" | |
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" | |
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}!" | |
ZSH_THEME_GIT_PROMPT_CLEAN="" | |
function prompt_char { | |
if [ $UID -eq 0 ]; then echo "%{$fg[red]%}#%{$reset_color%}"; else echo λ; fi | |
} | |
#PROMPT='%{$fg[magenta]%}%n%{$reset_color%}@%{$fg[yellow]%}%m%{$reset_color%}: %{$fg_bold[blue]%}%~%{$reset_color%}$(git_prompt_info) |
OlderNewer