Skip to content

Instantly share code, notes, and snippets.

View ARTUR-ZH's full-sized avatar
๐Ÿ˜Ž

Artur Zh ARTUR-ZH

๐Ÿ˜Ž
View GitHub Profile
import {
combineLatest,
distinctUntilChanged,
filter,
map,
Observable,
scan,
shareReplay,
switchMap,
withLatestFrom
@ARTUR-ZH
ARTUR-ZH / determine-changed-props.js
Created February 21, 2020 08:06 — forked from sorenlouv/determine-changed-props.js
Determine which props causes React components to re-render
import React, { Component } from 'react';
export default function withPropsChecker(WrappedComponent) {
return class PropsChecker extends Component {
componentWillReceiveProps(nextProps) {
Object.keys(nextProps)
.filter(key => {
return nextProps[key] !== this.props[key];
})
.map(key => {
@ARTUR-ZH
ARTUR-ZH / frida-extract-keystore.py
Created April 4, 2019 09:00 — forked from ceres-c/frida-extract-keystore.py
Automatically extract KeyStore objects and relative password from Android applications with Frida - Read more: http://ceres-c.it/frida-android-keystore/
#!/usr/bin/python3
'''
author: ceres-c
usage: ./frida-extract-keystore.py
Once the keystore(s) have been exported you have to convert them to PKCS12 using keytool
'''
import frida, sys, time
@ARTUR-ZH
ARTUR-ZH / gist:dacd016038192f1bff4d8a5445c34f3e
Created September 10, 2018 09:43 — forked from snowman-repos/gist:3825198
JavaScript: Detect Orientation Change on Mobile Devices
// Listen for orientation changes
window.addEventListener("orientationchange", function() {
// Announce the new orientation number
alert(window.orientation);
}, false);
// Listen for resize changes
window.addEventListener("resize", function() {
// Get screen size (inner/outerWidth, inner/outerHeight)
@ARTUR-ZH
ARTUR-ZH / s3.sh
Created May 23, 2018 11:32 — forked from chrismdp/s3.sh
Uploading to S3 in 18 lines of Shell (used to upload builds for http://soltrader.net)
# You don't need Fog in Ruby or some other library to upload to S3 -- shell works perfectly fine
# This is how I upload my new Sol Trader builds (http://soltrader.net)
# Based on a modified script from here: http://tmont.com/blargh/2014/1/uploading-to-s3-in-bash
S3KEY="my aws key"
S3SECRET="my aws secret" # pass these in
function putS3
{
path=$1
@ARTUR-ZH
ARTUR-ZH / GitCommitEmoji.md
Created March 14, 2018 14:37 — forked from parmentf/GitCommitEmoji.md
Git Commit message Emoji

Inspired by dannyfritz/commit-message-emoji

See also gitmoji.

Commit type Emoji
Initial commit ๐ŸŽ‰ :tada:
Version tag ๐Ÿ”– :bookmark:
New feature โœจ :sparkles:
Bugfix ๐Ÿ› :bug:
@ARTUR-ZH
ARTUR-ZH / mocha-guide-to-testing.js
Created February 12, 2018 14:47 — forked from samwize/mocha-guide-to-testing.js
Explain Mocha's testing framework - describe(), it() and before()/etc hooks
// # Mocha Guide to Testing
// Objective is to explain describe(), it(), and before()/etc hooks
// 1. `describe()` is merely for grouping, which you can nest as deep
// 2. `it()` is a test case
// 3. `before()`, `beforeEach()`, `after()`, `afterEach()` are hooks to run
// before/after first/each it() or describe().
//
// Which means, `before()` is run before first it()/describe()
# Logs
logs
*.log
npm-debug.log*
# Runtime data
pids
*.pid
*.seed
@ARTUR-ZH
ARTUR-ZH / global-gitignore.md
Created November 14, 2017 08:34 — forked from subfuzion/global-gitignore.md
Global gitignore

There are certain files created by particular editors, IDEs, operating systems, etc., that do not belong in a repository. But adding system-specific files to the repo's .gitignore is considered a poor practice. This file should only exclude files and directories that are a part of the package that should not be versioned (such as the node_modules directory) as well as files that are generated (and regenerated) as artifacts of a build process.

All other files should be in your own global gitignore file. Create a file called .gitignore in your home directory and add anything you want to ignore. You then need to tell git where your global gitignore file is.

Mac

git config --global core.excludesfile ~/.gitignore

Windows

git config --global core.excludesfile %USERPROFILE%\.gitignore
public override void ReceivedRemoteNotification (UIApplication application, NSDictionary userInfo)
{
processNotification(userInfo, false);
}
void processNotification(NSDictionary options, bool fromFinishedLaunching)
{
//Check to see if the dictionary has the aps key. This is the notification payload you would have sent
if (null != options && options.ContainsKey(new NSString("aps")))
{