Skip to content

Instantly share code, notes, and snippets.

View wtrocki's full-sized avatar
🚀
Making API Backends an Better Place!

Wojciech Trocki wtrocki

🚀
Making API Backends an Better Place!
View GitHub Profile
global.window = {};
window.localStorage = {
getItem: () => {
console.info("Called");
},
setItem: () => {
console.info("Called");
}
};
oc cluster up --version v3.9.0 --image openshift/origin --public-hostname 127.0.0.1 --routing-suffix apps.127.0.0.1.nip.io --host-data-dir /Users/wtrocki/.oc/profiles/test/data --host-config-dir /Users/wtrocki/.oc/profiles/test/config --host-pv-dir /Users/wtrocki/.oc/profiles/test/pv --use-existing-config -e TZ=IST
@wtrocki
wtrocki / cordovaTurnOffAndOnAgain.sh
Created May 18, 2018 15:28
Cordova Script that you should execute before logging issue to Cordova Platform
## Start with fresh env
rm -Rf ./platform
rm -Rf ./plugins
cordova prepare
@wtrocki
wtrocki / Root cert.md
Last active June 11, 2018 21:20
Draft instruction to install certificate on the phone

This is some instructions for how to to extract the root cert for the openshift route and install on a real device.

openssl s_client -showcerts -connect host:port

For example

openssl s_client -showcerts -connect 192.168.37.1:8443
@wtrocki
wtrocki / use_tag.sh
Last active June 11, 2018 12:42 — forked from david-martin/use_tag.sh
Usage: `./use_tag.sh 1.0.0-alpha`
#!/bin/sh
set -x
TAG=1.0.0-alpha
oc patch deployment webconsole -n openshift-web-console -p "{\"spec\": {\"template\": {\"spec\": {\"containers\": [{\"name\": \"webconsole\", \"image\": \"aerogear/origin-web-console:$TAG\"}]}}}}"
#oc get configmap broker-config -n ansible-service-broker -o yaml | sed -e "s/tag:.*/tag: \"$TAG\"/" | oc replace -n ansible-service-broker -f -
@wtrocki
wtrocki / AndroidManifest.xml
Created July 3, 2018 08:41 — forked from BrandonSmith/AndroidManifest.xml
Quick example of how to schedule a notification in the future using AlarmManager
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.cards.notification">
<uses-sdk
android:minSdkVersion="17"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
## on postgress container
psql
CREATE DATABASE aerogeardatasyncserver_postgres_memeo;
DROP TABLE IF EXISTS comment;
DROP TABLE IF EXISTS meme;
DROP TABLE IF EXISTS profile;
CREATE TABLE profile (
id SERIAL NOT NULL PRIMARY KEY,
@wtrocki
wtrocki / postgres-cheatsheet.md
Created August 9, 2018 15:12 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@wtrocki
wtrocki / Note to Frequency
Created August 21, 2018 22:22 — forked from stuartmemo/Note to Frequency
Convert note to frequency
// Takes string of Note + Octave
// Example:
// var frequency = getFrequency('C3');
var getFrequency = function (note) {
var notes = ['A', 'A#', 'B', 'C', 'C#', 'D', 'D#', 'E', 'F', 'F#', 'G', 'G#'],
octave,
keyNumber;
if (note.length === 3) {