Skip to content

Instantly share code, notes, and snippets.

View sbycrosz's full-sized avatar
💭
I may be slow to respond.

Sam Aryasa sbycrosz

💭
I may be slow to respond.
View GitHub Profile
@sbycrosz
sbycrosz / export-fastlane-match.rb
Created September 20, 2022 03:03
Export fastlane match signing credentials for AppCenter
# Export iOS code signing as p12 and mobileprovision file for usage in Appcenter
# Manual decryption as described on https://docs.fastlane.tools/actions/match/
desc "Export fastlane match signing credentials for AppCenter"
lane :export_code_signing do
ensure_env_vars(
env_vars: [
"MATCH_GIT_URL",
"MATCH_PASSWORD",
]
@sbycrosz
sbycrosz / HierarchylessDetoxReporter.js
Last active December 6, 2020 19:36
Custom jest reporter for wix/detox that surpress printing of the entire page's UI hierarchy on failed spec
// HierarchylessDetoxReporter.js
// Custom jest reporter for wix/detox that surpress printing of the entire page's UI hierarchy on failed spec
// Github issue: https://github.com/wix/Detox/issues/992
// Usage (in your jest config): "reporters": ["./e2e/HierarchylessDetoxReporter.js"],
const StreamlineReporter = require('detox/runners/jest/streamlineReporter');
const HIERARCHY_REGEX_TRIMMER = /[\s\S]+?(?=Hierarchy)/;
class HierarchylessDetoxReporter extends StreamlineReporter {
@cucumbur
cucumbur / simple-reporter.js
Last active May 14, 2019 09:41
A simple hacky reporter I wrote for mocha & Detox that excludes 'excessive' technical information. Place it in the root directory and add --reporter simple-reporter to mocha.opts
// simple-reporter.js
var mocha = require('mocha')
module.exports = SimpleReporter
const trimregex = /[\s\S]+?(?=Hierarchy)/ // or /[\s\S]+?(?=Error Trace)/ or /[\s\S]+?(?=Exception)/ etc
function SimpleReporter (runner) {
mocha.reporters.Base.call(this, runner)
var passes = 0
var failures = 0
@ericnograles
ericnograles / graphql_types_assembler.js
Created January 18, 2018 15:01
Dynamic construction of .graphql files as one schema text file to load to makeExecutableSchema
const path = require('path');
const fs = require('fs');
const topLevelQuery = fs.readFileSync(
path.resolve(__dirname, 'Query.graphql'),
{ encoding: 'UTF-8' }
);
let types = fs
.readdirSync(__dirname)
.filter(fileName => {
// place this file in __mocks__
let pendingAssertions
exports.prompt = prompts => {
if (!pendingAssertions) {
throw new Error(`inquirer was mocked and used without pending assertions: ${prompts}`)
}
const answers = {}
@teameh
teameh / PanResponder_Overview.js
Last active October 21, 2023 05:28
React native PanResponder interface overview
this._panResponder = PanResponder.create({
// ----------- NEGOTIATION:
// A view can become the touch responder by implementing the correct negotiation methods.
// Should child views be prevented from becoming responder on first touch?
onStartShouldSetPanResponderCapture: (evt, gestureState) => () => {
console.info('onStartShouldSetPanResponderCapture');
return true;
},
@billwang1990
billwang1990 / ObjectMapper+Alamofire+RxSwift
Created October 30, 2015 06:24
ObjectMapper+Alamofire+RxSwift
//
// RxAlamofireObjMapper.swift
// RXDemo
//
// Created by Yaqing Wang on 10/30/15.
// Copyright © 2015 billwang1990.github.io. All rights reserved.
//
import Foundation
import Alamofire
@brianloveswords
brianloveswords / git-obliterate
Last active January 24, 2024 12:28
git-obliterate: for removing sensitive files you may have committed from the entire history of the project.
#!/bin/bash
file=$1
test -z $file && echo "file required." 1>&2 && exit 1
git filter-branch -f --index-filter "git rm -r --cached $file --ignore-unmatch" --prune-empty --tag-name-filter cat -- --all
git ignore $file
git add .gitignore
git commit -m "Add $file to .gitignore"