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
@wtrocki
wtrocki / multiple_ssh_setting.md
Created November 12, 2015 12:48 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "[email protected]"
@wtrocki
wtrocki / templateSettings.js
Created May 23, 2016 20:27 — forked from dhoko/templateSettings.js
Lodash/underscore custom template settings with {{ }}
_.templateSettings = {
evaluate: /{{+([\s\S]+?)}}/g,
interpolate: /{{([\s\S]+?)}}/g,
escape: /{{-([\s\S]+?)}}/g
};
@wtrocki
wtrocki / SMBDIS.ASM
Created January 29, 2017 19:08 — forked from 1wErt3r/SMBDIS.ASM
A Comprehensive Super Mario Bros. Disassembly
;SMBDIS.ASM - A COMPREHENSIVE SUPER MARIO BROS. DISASSEMBLY
;by doppelganger ([email protected])
;This file is provided for your own use as-is. It will require the character rom data
;and an iNES file header to get it to work.
;There are so many people I have to thank for this, that taking all the credit for
;myself would be an unforgivable act of arrogance. Without their help this would
;probably not be possible. So I thank all the peeps in the nesdev scene whose insight into
;the 6502 and the NES helped me learn how it works (you guys know who you are, there's no
@wtrocki
wtrocki / samplerest.js
Created August 24, 2017 12:36 — forked from joshbirk/samplerest.js
Sample of using passport w/ mult strategies
var fs = require("fs")
var ssl_options = {
key: fs.readFileSync('privatekey.pem'),
cert: fs.readFileSync('certificate.pem')
};
var port = process.env.PORT || 3000;
var express = require('express');
var ejs = require('ejs');
var passport = require('passport')
@wtrocki
wtrocki / .eslintrc
Created November 28, 2017 13:11 — forked from radiovisual/.eslintrc
React Native AirBnB ESLint Config
{
"parser": "babel-eslint",
"plugins": [
"react",
"react-native"
],
"parserOptions": {
"ecmaFeatures": {
"jsx": true,
"modules": true
@wtrocki
wtrocki / MetricsIntegrationTest.swift
Last active April 9, 2018 09:42 — forked from psturc/MetricsIntegrationTest.swift
metrics integration testing
//
// MetricsIntegrationTest.swift
// AeroGearSdkExampleTests
@testable import AGSCore
import Foundation
import XCTest

HTTP Rest API receive 'push request', this gets processed in PushNotificationSenderEndpoint.send(), which eventually calls an async EJB (NotificationRouter.submit()) which performs a grouping/mapping and fires a CDI event per Variant.

This Event is received in the MessageHolderWithVariantsProducer.queueMessageVariantForProcessing() method, which basically sticks the submitted event into a transactional JMS send, based on the variant type a different queue is selected (mainly to keep things separated). The JMS listener MessageHolderWithVariantsConsumer.onMessage() reads from these queues, and fires a different CDI event, which kicks in the TokenLoader.

The TokenLoader generally iterates over all variants (for a given type, see the grouping/mapping done in NotificationRouter), and starts to query tokens from the database, as a steam.

The tokens are in different batches, with different default sizes per Push_Network, to not overflow the push network (e.g. google (non topic case) only allows 1

@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"
@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)