Skip to content

Instantly share code, notes, and snippets.

View binho's full-sized avatar

Cleber Santos binho

View GitHub Profile
@binho
binho / caixa_modulo_seguranca_macOS.md
Last active June 29, 2024 03:02
Como instalar/reinstalar o módulo de segurança da Caixa no macOS

Bom vou falar um pouco da minha luta com o Internet Banking da Caixa.

No meu caso tive problemas após migrar o meu macbook para um novo e não conseguia instalar o módulo de segurança no novo macbook e assim sem poder usar o Internet Banking no computador.

Primeiro rodei o script sudo /usr/local/bin/warsaw/uninstall.sh do warsaw como root pra tentar começar tudo do zero mas ainda assim após tentar reinstalar não tive sucesso.

Ao analisar o script postinstall dentro do pkg notei que varios arquivos de inicialização são criados e que alguns dados ainda continuaram no meu computador como certificados e arquivos de inicialização, então tenha certeza que estes arquivos abaixo tenham sido removidos:

rm -f ~/Library/LaunchAgents/com.diebold.warsaw.user.plist
@binho
binho / fibo_objc.m
Created December 26, 2016 11:51
Fibonnaci Objective-C (Returns an array)
- (NSArray *)fibonnaci:(NSNumber *)number {
NSMutableArray *array = [NSMutableArray new];
for (int i = 0; i < [number intValue]; i++) {
if (i < 2) {
[array addObject:@(i)];
} else {
int fib = ([array[i-1] intValue] + [array[i-2] intValue]);
[array addObject:@(fib)];
}
@binho
binho / viewModelTest.m
Created December 21, 2016 12:48
Testing view model in XCTest
#import <XCTest/XCTest.h>
#import "Person.h"
#import "PersonViewModel.h"
@interface SimpleMVVMTests : XCTestCase
@property (nonatomic) NSString *salutation;
@property (nonatomic) NSString *fullName;
@property (nonatomic) NSDate *birthDate;
#!/bin/bash
DIRECTORY=$1
echo "------------------------------"
echo "Passed Resources with xcassets folder argument is <$DIRECTORY>"
echo "------------------------------"
XC_ASSETS="$(find "$DIRECTORY" -name '*.xcassets')"
for xcasset in $XC_ASSETS; do
echo "-- 📦 XC Asset: $xcasset"
@binho
binho / localization-report.py
Last active September 22, 2016 12:47
Localization Report
#!/usr/bin/python
# -*- coding: utf-8 -*-
import fnmatch
import sys
import os
num_strings_base = 0
strings_on_base = []
@binho
binho / download-subtitles.py
Last active September 1, 2016 19:52
Download subtitles using subliminal lib (https://github.com/Diaoul/subliminal)
#!/usr/bin/python
# -*- coding: utf-8 -*-
from datetime import timedelta
from babelfish import Language
from subliminal import download_best_subtitles, region, save_subtitles, scan_videos
import sys
import os
"""
@binho
binho / xcode_targets_check.md
Last active May 23, 2017 10:19
Xcode Build Phase for checking targets

Note: This build phase script should be added in all targets!

TARGET_NAMES=( ShowMe ShowMeDev ShowMeEnterprise )
PREV_TOTAL=0

for TARGET_NAME in "${TARGET_NAMES[@]}"; do
    TOTAL=`XcodeProjectTargetCheck -xcproj ${SRCROOT}/ShowMe.xcodeproj -targets ${TARGET_NAME} | wc -l`
    echo 'Target Name: '${TARGET_NAME} '- Total Files: '${TOTAL}
@binho
binho / mogenerator_current_version.sh
Created July 27, 2015 18:11
Mogenerator generate based on version
type mogenerator >/dev/null 2>&1 || {
echo >&2 "Warning: mogenerator not found. You will need it when changing core data model";
exit 0;
}
cd "${SOURCE_ROOT}/${PROJECT_NAME}"
PATH_TO_MODELD="Resources/Model/${PROJECT_NAME}.xcdatamodeld"
CURRENT_MODEL_VERSION=$(/usr/libexec/PlistBuddy -c "Print :_XCCurrentVersionName" "${PATH_TO_MODELD}/.xccurrentversion")
MODEL_PATH="${PATH_TO_MODELD}/${CURRENT_MODEL_VERSION}"
@binho
binho / magicalrecord_reset_coredata.m
Created April 2, 2015 19:48
MagicalRecord remove and reset CoreData
- (void)resetCoreData {
DDLogInfo(@"[RESET-COREDATA] Started.");
[MagicalRecord cleanUp];
NSURL *storeURL = [NSPersistentStore MR_urlForStoreName:kMobilStoreName];
NSURL *walURL = [[storeURL URLByDeletingPathExtension] URLByAppendingPathExtension:@"sqlite-wal"];
NSURL *shmURL = [[storeURL URLByDeletingPathExtension] URLByAppendingPathExtension:@"sqlite-shm"];
@binho
binho / ti-download-files-with-activity.js
Last active August 29, 2015 14:02
Titanium SDK - Android - Show activity indicator android download files
if (Ti.Platform.osname == 'android') {
var filesToDownload = [
{url: "http://site.com/image1.jpg"},
{url: "http://site.com/image2.jpg"},
{url: "http://site.com/image3.jpg"}
];
var totalFiles = filesToDownload.length;