Skip to content

Instantly share code, notes, and snippets.

Avatar
😏

Sam Seay samueljseay

😏
View GitHub Profile
@tinmegali
tinmegali / AppDatabse.kt
Last active May 4, 2021
Android Room @TypeConverter using Kotlin
View AppDatabse.kt
@Database(entities = arrayOf(Note::class, User::class), version = 1)
@TypeConverters(Converters::class)
abstract class AppDatabse : RoomDatabase() {
abstract fun userDAO(): UserDAO
abstract fun noteDAO(): NoteDAO
}
@samueljseay
samueljseay / es6-import-cheat-sheet.md
Created Jun 2, 2017
ES6 exports / imports cheat sheet
View es6-import-cheat-sheet.md
// default exports
export default 42;
export default {};
export default [];
export default (1 + 2);
export default foo;
export default function () {}
export default class {}
export default function foo () {}
View ethos-suprnova
Mining with ethOS on Suprnova.
So ethOS is basically shipped per default to mine on pools such as ethermine, nanopool and others that use wallet addresses as the account and that do NOT require workers.
Classic pools like Suprnova and Coinmine do require workers, this is where you need special steps to be able to mine on it with ethOS.
First of all, you will need to add a worker on Suprnova for EACH ethOS rigs you have.
The worker MUST be your rig's hostname. To find out, simply login in SSH and you'll see a similar line:
08:26 PM root@bd3655 10.34.0.187 [71.5 hash] /root #
In this case here, our worker will be bd3655.
@maciekish
maciekish / resetXcode.sh
Created Aug 10, 2016
Reset Xcode. Clean, clear module cache, Derived Data and Xcode Caches. You can thank me later.
View resetXcode.sh
#!/bin/bash
killall Xcode
xcrun -k
xcodebuild -alltargets clean
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang/ModuleCache"
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang.$(whoami)/ModuleCache"
rm -rf ~/Library/Developer/Xcode/DerivedData/*
rm -rf ~/Library/Caches/com.apple.dt.Xcode/*
open /Applications/Xcode.app
@henriquemenezes
henriquemenezes / android-generate-keystores.md
Last active Sep 14, 2021
Android: Generate Release/Debug Keystores
View android-generate-keystores.md

Android: Generate Release/Debug Keystores

Generate Keystores

Debug Keystore

$ keytool -genkey -v -keystore debug.keystore -storepass android -alias androiddebugkey -keypass android -keyalg RSA -keysize 2048 -validity 10000 -dname "C=US, O=Android, CN=Android Debug"
@destan
destan / ParseRSAKeys.java
Last active Sep 14, 2021
Parse RSA public and private key pair from string in Java
View ParseRSAKeys.java
import java.io.IOException;
import java.net.URISyntaxException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.security.KeyFactory;
import java.security.NoSuchAlgorithmException;
import java.security.PrivateKey;
import java.security.interfaces.RSAPublicKey;
import java.security.spec.InvalidKeySpecException;
import java.security.spec.PKCS8EncodedKeySpec;
@dpmedeiros
dpmedeiros / AndroidMockUtil.java
Last active Jan 28, 2021
Mock main thread handler for use in Android unit tests (requires Mockito and PowerMock)
View AndroidMockUtil.java
package com.dpmedeiros.androidtestsupportlibrary;
import android.os.Handler;
import android.os.Looper;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
import org.powermock.api.mockito.PowerMockito;
import java.util.concurrent.Executors;
@lopspower
lopspower / README.md
Last active Sep 20, 2021
Hexadecimal color code for transparency
View README.md

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store

@wenzhixin
wenzhixin / ubuntu14.04-command-line-install-android-sdk
Last active Mar 23, 2021
Ubuntu 14.04 command line install android sdk
View ubuntu14.04-command-line-install-android-sdk
# install openjdk
sudo apt-get install openjdk-7-jdk
# download android sdk
wget http://dl.google.com/android/android-sdk_r24.2-linux.tgz
tar -xvf android-sdk_r24.2-linux.tgz
cd android-sdk-linux/tools
# install all sdk packages
@jensgro
jensgro / enterprise-link.html
Last active Feb 10, 2019
Enterprise-Code from hell
View enterprise-link.html