Skip to content

Instantly share code, notes, and snippets.

@RafalWilinski
RafalWilinski / ionic-repair.sh
Last active May 5, 2017 00:17
Complete solution for repairing your Ionic app
ps aux | grep deploy | tr -s " " | cut -d " " -f2 | xargs kill
ps aux | grep lldb | tr -s " " | cut -d " " -f2 | xargs kill
sudo npm update
sudo npm uninstall cordova ionic ios-sim ios-deploy
sudo npm install -g cordova ionic ios-sim ios-deploy
cordova platform rm ios
cordova platform add ios
ionic prepare ios
ionic state reset
ionic state restore
@RafalWilinski
RafalWilinski / docker_utils.sh
Last active February 4, 2020 10:33
Docker Useful commands
# Delete all images
docker images | tr -s ' ' | cut -d ' ' -f3 | xargs docker rmi -f
# To delete not running images and ghost ones:
docker rm `docker ps --no-trunc -aq`
# Delete kill all containers
docker ps | tr -s ' ' | cut -d ' ' f2 | xargs docker kill
# Delete all volumes
@RafalWilinski
RafalWilinski / code.js
Last active June 28, 2016 08:26
StackOverflow #38070287 Code Answer
// http://stackoverflow.com/questions/38070287/nodejs-how-to-manage-username-and-task-management-without-using-external-datab?noredirect=1#comment63578743_38070287
// On server start load data from file
var storage = {tasks: []};
fs.readFile('database.json', function(err, data) {
if(err) throw new Error(err);
storage = JSON.parse(data);
});
// On incoming request
if (query.id == '1') {
@RafalWilinski
RafalWilinski / 0_reuse_code.js
Created June 30, 2017 11:08
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@RafalWilinski
RafalWilinski / redux-api-middleware-rn.fix
Last active July 8, 2017 16:54
How to Fix `redux-api-middleware` + React Native
1. Go to `/node_modules/redux-api-middleware`
2. Open `package.json` and add `"react-native": "fetch-npm-react-native.js",` after `main` key
3. Run `echo "module.exports = this;" > fetch-npm-react-native.js`
4. Restart RN server
@RafalWilinski
RafalWilinski / modals_example.jsx
Created July 29, 2017 21:44
React/Redux best practice example
// consts/index.js
export const SHOW_MODAL = 'ui/SHOW_MODAL'
export const HIDE_MODAL = 'ui/HIDE_MODAL'
// reducers/ui.js
import { SHOW_MODAL, HIDE_MODAL } from '../consts'
const initialState = {
activeModal: null

Keybase proof

I hereby claim:

  • I am rafalwilinski on github.
  • I am rafwilinski (https://keybase.io/rafwilinski) on keybase.
  • I have a public key ASBiCUFaXIYxtVkZaGXkfVJNxOB9QKiwd7tyDTIEGRPAHAo

To claim this, I am signing this object:

let kv = {};
let set = new Set();
let map = new Map();
const { performance } = require('perf_hooks');
const numOfBlacklisted = 3500000;
const numOfChecks = 100000;
const putToKv = (ip) => {
kv[ip] = true;
name: Build/release
on:
release:
types: # This configuration does not affect the page_build event above
- created
jobs:
release:
runs-on: ${{ matrix.os }}
@RafalWilinski
RafalWilinski / AWS Marketplace Contract Flow.md
Created April 16, 2022 15:08
Visual diagram of How AWS Marketplace fit into your Monthly/Annual subscriptions model
sequenceDiagram
  participant User
  participant AWS Marketplace Product Page
  participant Your Marketplace Landing Form
  participant Your subscriptions API
  participant AWS Marketplace Metering Service

  User ->> AWS Marketplace Product Page: Visits
   User ->> AWS Marketplace Product Page: Purchases contract/subscription