Skip to content

Instantly share code, notes, and snippets.

View fanky10's full-sized avatar

Ewen Mackenzie fanky10

  • Disney
  • Orlando
  • 07:23 (UTC -05:00)
View GitHub Profile
@bluelovers
bluelovers / ChatGPT Stable Diffusion prompts generator.txt
Last active September 26, 2024 12:49
using ChatGPT as Stable Diffusion prompts generator
Stable Diffusion is an AI art generation model similar to DALLE-2.
Here are some prompts for generating art with Stable Diffusion.
Example:
- A ghostly apparition drifting through a haunted mansion's grand ballroom, illuminated by flickering candlelight. Eerie, ethereal, moody lighting.
- portait of a homer simpson archer shooting arrow at forest monster, front game card, drark, marvel comics, dark, smooth
- pirate, deep focus, fantasy, matte, sharp focus
- red dead redemption 2, cinematic view, epic sky, detailed, low angle, high detail, warm lighting, volumetric, godrays, vivid, beautiful
- a fantasy style portrait painting of rachel lane / alison brie hybrid in the style of francois boucher oil painting, rpg portrait
@DevSrSouza
DevSrSouza / ServiceExtensions.kt
Last active October 25, 2023 18:14
Connecting to a service using Kotlin Coroutines
import android.app.Service
import android.content.ComponentName
import android.content.Context
import android.content.Intent
import android.content.ServiceConnection
import android.os.IBinder
import kotlin.coroutines.resume
import kotlin.coroutines.suspendCoroutine
suspend inline fun <reified S : Service, B : IBinder> Context.connectService(
@hormesiel
hormesiel / Device.java
Last active May 29, 2024 11:47
How to get an Android device's serial number, visible to the user in "Settings > About phone/tablet/device > Status > Serial number".
import android.os.Build;
import java.lang.reflect.Method;
public class Device {
/**
* @return The device's serial number, visible to the user in {@code Settings > About phone/tablet/device > Status
* > Serial number}, or {@code null} if the serial number couldn't be found
*/
public static String getSerialNumber() {
@chourobin
chourobin / 0-bridging-react-native-cheatsheet.md
Last active November 15, 2024 13:32
React Native Bridging Cheatsheet
@adriangl
adriangl / pre-commit
Created November 23, 2016 13:28
Git pre-commit script for running Checkstyle in all Android-Studio based project files
#!/bin/sh
#Define paths where the checkstyle file is and where to check for style inconsistencies
CHECKSTYLE_PATH="checkstyle.xml"
CHECKSTYLE_FOLDERS_TO_CHECK="app/src/main/java app/src/androidTest/java app/src/test/java"
#Check if the 'checkstyle' command is installed
#Magic: http://stackoverflow.com/a/677212
command -v checkstyle >/dev/null 2>&1 || { echo >&2 "checkstyle is not installed, aborting.\nInstall it using brew or apt-get"; exit 1; }
#Run checkstyle over our files
@mcguinness
mcguinness / umbrella
Created August 23, 2016 03:58 — forked from quinncomendant/umbrella
OpenDNS umbrella start/stop script for Mac OS X. This makes it easy to turn umbrella off temporarily, or get its status.
#!/usr/bin/env bash
# Quinn Comendant <[email protected]>
# https://gist.github.com/quinncomendant/3be731567e529415d5ee
# Since 25 Jan 2015
# Version 1.1
CMD=$1;
if [[ `id -u` = 0 ]]; then
@SamWhited
SamWhited / TimePreference.java
Created December 17, 2014 00:10
Time picker preference for Android
import android.content.Context;
import android.content.res.TypedArray;
import android.preference.DialogPreference;
import android.preference.Preference;
import android.util.AttributeSet;
import android.view.View;
import android.widget.TimePicker;
import java.text.DateFormat;
import java.util.Calendar;
@DanHerbert
DanHerbert / fix-homebrew-npm.md
Last active September 15, 2024 20:33
Instructions on how to fix npm if you've installed Node through Homebrew on Mac OS X or Linuxbrew

OBSOLETE

This entire guide is based on an old version of Homebrew/Node and no longer applies. It was only ever intended to fix a specific error message which has since been fixed. I've kept it here for historical purposes, but it should no longer be used. Homebrew maintainers have fixed things and the options mentioned don't exist and won't work.

I still believe it is better to manually install npm separately since having a generic package manager maintain another package manager is a bad idea, but the instructions below don't explain how to do that.

Fixing npm On Mac OS X for Homebrew Users

Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.