Skip to content

Instantly share code, notes, and snippets.

PRSoluções prsolucoes

Block or report user

Report or block prsolucoes

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View git-clear-history.sh
-- Remove the history from
rm -rf .git
-- recreate the repos from the current content only
git init
git add .
git commit -m "Initial commit"
-- push to the github remote repos ensuring you overwrite history
git remote add origin git@github.com:<YOUR ACCOUNT>/<YOUR REPOS>.git
@prsolucoes
prsolucoes / MemorySamples.cpp
Last active Dec 21, 2018
C++ memory samples
View MemorySamples.cpp
#include <iostream>
#include <string>
#include <vector>
#include <memory>
void show_1(int value) {
std::cout << "show_1: " << &value << std::endl;
}
void show_2(int & value) {
@prsolucoes
prsolucoes / OkHttpUtils.java
Created Nov 19, 2018
OkHttp utility class to stop call by tag
View OkHttpUtils.java
package com.prsolucoes.android;
import android.text.TextUtils;
import okhttp3.Call;
import okhttp3.OkHttpClient;
public class OkHttpUtils {
public static void cancelCallWithTag(OkHttpClient client, String tag) {
@prsolucoes
prsolucoes / workaround-player.m
Created Sep 19, 2018
Workaround to enable audio session
View workaround-player.m
- (void)activateAudioSession
{
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:nil];
[[AVAudioSession sharedInstance] setActive:YES error:nil];
}
View xcode-clean.sh
#!/bin/sh
text_magenta=$(tput setaf 5)
text_bold=$(tput bold)
text_normal=$(tput sgr0)
archives_path=~/"Library/Developer/Xcode/Archives"
derived_data_path=~/"Library/Developer/Xcode/DerivedData"
simulator_data_path=~/"Library/Developer/CoreSimulator/Devices"
device_support_path=~/"Library/Developer/Xcode/iOS DeviceSupport"
@prsolucoes
prsolucoes / xcode-envs.txt
Created Jan 3, 2018
Xcode Environment Variables
View xcode-envs.txt
ACTION = build
AD_HOC_CODE_SIGNING_ALLOWED = NO
ALTERNATE_GROUP = staff
ALTERNATE_MODE = u+w,go-w,a+rX
ALTERNATE_OWNER = grantdavis
ALWAYS_SEARCH_USER_PATHS = NO
ALWAYS_USE_SEPARATE_HEADERMAPS = YES
APPLE_INTERNAL_DEVELOPER_DIR = /AppleInternal/Developer
APPLE_INTERNAL_DIR = /AppleInternal
APPLE_INTERNAL_DOCUMENTATION_DIR = /AppleInternal/Documentation
@prsolucoes
prsolucoes / install-cmake.sh
Created Dec 21, 2017
Install CMake 3.10 from source
View install-cmake.sh
version=3.10
build=1
mkdir ~/temp
cd ~/temp
wget https://cmake.org/files/v$version/cmake-$version.$build.tar.gz
tar -xzvf cmake-$version.$build.tar.gz
cd cmake-$version.$build/
./bootstrap
make -j4
sudo make install
View gist:a73129f7ee8d126cb9ac5fcc66a45555
shared/rpi3-custom/build/tmp/work/x86_64-linux/automake-native/1.15.1-r0//temp/log.do_configure:Check your system clock
shared/rpi3-custom/build/tmp/work/x86_64-linux/automake-native/1.15.1-r0//temp/log.do_configure.12548:Check your system clock
shared/rpi3-custom/build/tmp/work/x86_64-linux/automake-native/1.15.1-r0//automake-1.15.1/configure:Check your system clock" "$LINENO" 5
grep: shared/rpi3-custom/build/tmp/work/x86_64-linux/automake-native/1.15.1-r0//automake-1.15.1/patches/0001-automake-Add-default-libtool_tag-to-cppasm.patch: No such file or directory
grep: shared/rpi3-custom/build/tmp/work/x86_64-linux/automake-native/1.15.1-r0//automake-1.15.1/patches/new_rt_path_for_test-driver.patch: No such file or directory
grep: shared/rpi3-custom/build/tmp/work/x86_64-linux/automake-native/1.15.1-r0//automake-1.15.1/patches/automake-replace-w-option-in-shebangs-with-modern-use-warnings.patch: No such file or directory
grep: shared/rpi3-custom/build/tmp/work/x86_64-linux/automake-native/1.15.1-r0//automake-1.
@prsolucoes
prsolucoes / ArvoreSecurityUtil.java
Created Aug 6, 2017
ArvoreSecurityUtil - Decryptor para Árvore
View ArvoreSecurityUtil.java
package com.ubook.reader.util;
import android.util.Base64;
import android.util.Log;
import javax.crypto.Cipher;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
public class ArvoreSecurityUtil {
@prsolucoes
prsolucoes / jwt.go
Created Jul 29, 2017
autenticação com jwt
View jwt.go
package main
// using asymmetric crypto/RSA keys
import (
"crypto/rsa"
"fmt"
"io/ioutil"
"log"
"net/http"
You can’t perform that action at this time.