Skip to content

Instantly share code, notes, and snippets.

View indatawetrust's full-sized avatar
🏠
Working from home

Ahmet Şimşek‎ indatawetrust

🏠
Working from home
View GitHub Profile
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
@indatawetrust
indatawetrust / Dockerfile
Last active April 10, 2019 16:06 — forked from RinatMullayanov/Dockerfile
Ubuntu Node.js Dockerfile WebRTC
#
# 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
Array.from(document.querySelectorAll('[message]')).forEach(function(el) {
el.setAttribute('oninvalid', 'this.setCustomValidity("' + el.getAttribute('message') + '")');
el.setAttribute('oninput', 'this.setCustomValidity("")')
})
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)
}
}
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) {
@indatawetrust
indatawetrust / gist:cc1b3b1aca36f26e5e183b6f01e155e6
Created March 6, 2019 08:18
Debian (e.g. Ubuntu) Dependencies
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
find . "..." -not -path "./node_modules/*" -not -path "./.git/*" -not -path "./public/*"
grep -rnw . -e "..." --exclude-dir={node_modules,.git,public}
mysql.server start
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
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]) %}
@indatawetrust
indatawetrust / wp_categories.sql
Created January 11, 2019 11:05
wordpress categories and total courses
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