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
| ionic cordova build android --prod --release | |
| rm app-release-unsigned.apk | |
| cp platforms/android/app/build/outputs/apk/release/app-release-unsigned.apk . | |
| jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-release-key.jks -storepass PASSWORD -keypass PASSWORD app-release-unsigned.apk my-alias | |
| rm HelloWorld.apk | |
| ~/Library/Android/sdk/build-tools/24.0.3/zipalign -v 4 app-release-unsigned.apk HelloWorld.apk |
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
| # | |
| # Ubuntu Node.js Dockerfile | |
| # | |
| # https://github.com/dockerfile/ubuntu/blob/master/Dockerfile | |
| # https://docs.docker.com/examples/nodejs_web_app/ | |
| # | |
| # Pull base image. | |
| FROM ubuntu:14.04 | |
| RUN apt-get update && apt-get install -y apt-transport-https |
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
| Array.from(document.querySelectorAll('[message]')).forEach(function(el) { | |
| el.setAttribute('oninvalid', 'this.setCustomValidity("' + el.getAttribute('message') + '")'); | |
| el.setAttribute('oninput', 'this.setCustomValidity("")') | |
| }) |
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
| class Actor { | |
| constructor({state, actions, view}) { | |
| this.state = state | |
| for (let [key, value] of Object.entries(actions)) { | |
| if (typeof value == "function") { | |
| actions[key] = value.bind(this, 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
| Array.prototype.uniq = function(key) { | |
| return key | |
| ? this.map(e => e[key]) | |
| .map((e, i, final) => final.indexOf(e) === i && i) | |
| .filter(e => this[e]) | |
| .map(e => this[e]) | |
| : [...new Set(this)]; | |
| } | |
| Array.prototype.asyncMap = async function(func) { |
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
| apt install gconf-service libasound2 libatk1.0-0 libatk-bridge2.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget |
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
| find . "..." -not -path "./node_modules/*" -not -path "./.git/*" -not -path "./public/*" | |
| grep -rnw . -e "..." --exclude-dir={node_modules,.git,public} | |
| mysql.server start |
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
| sudo mkfs.ext4 -m 0 -F -E lazy_itable_init=0,lazy_journal_init=0,discard /dev/sdb | |
| sudo mkdir -p /mnt/disks/sdb | |
| sudo mount -o discard,defaults /dev/sdb /mnt/disks/sdb |
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
| sum -> sum "+" product {% d => d[0] + d[2] %} | |
| | sum "-" product {% d => d[0] - d[2] %} | |
| | product {% d => d[0] %} | |
| product -> product "*" factor {% d => d[0] * d[2] %} | |
| | product "/" factor {% d => d[0] / d[2] %} | |
| | factor {% d => d[0] %} | |
| factor -> "(" sum ")" {% d => d[1] %} | |
| | float {% d => d[0] %} | |
| float -> num "." num {% d => parseFloat(d[0] + d[1] + d[2]) %} | |
| | num {% d => parseInt(d[0]) %} |
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
| SELECT t.term_id, | |
| t.name, | |
| t.slug, | |
| count(post.ID) AS total | |
| FROM wp_terms AS t | |
| INNER JOIN wp_term_taxonomy AS tt ON (t.term_id = tt.term_id) | |
| INNER JOIN wp_term_relationships AS tr ON (tr.term_taxonomy_id = tt.term_taxonomy_id) | |
| LEFT JOIN wp_posts post ON (post.ID = tr.object_id) | |
| WHERE tt.taxonomy IN ('course_category') | |
| GROUP BY t.term_id |