Skip to content

Instantly share code, notes, and snippets.

View monmonja's full-sized avatar

Almond Joseph Mendoza monmonja

View GitHub Profile
const fs = require('fs');
const path = require('path');
const readline = require('readline');
const API_URL = "https://api-inference.huggingface.co/models/black-forest-labs/FLUX.1-schnell";
const headers = {
"Authorization": "Bearer <Hugging face token>",
"Content-Type": "application/json"
};
@monmonja
monmonja / gist:6cc535757c6f0e2c188612d75f2c0dea
Created November 17, 2020 03:19
ses amazon php smtp test
$login = 'username';
$pass = 'password';
$ctx = stream_context_create();
stream_context_set_option($ctx, 'ssl', 'verify_peer', false);
stream_context_set_option($ctx, 'ssl', 'verify_peer_name', false);
$socket = stream_socket_client('tcp://email-smtp.ap-southeast-2.amazonaws.com:25', $err, $errstr, 60, STREAM_CLIENT_CONNECT, $ctx);
try {
if (!$socket) {
print "Failed to connect $err $errstr\n";
@monmonja
monmonja / generate-ios.sh
Created July 16, 2019 13:16
generate ios from command line
# download this file to your project folder and excute
# chmod +x generate-ios.sh
# then run using
# ./generate-ios.sh
# flutter build defaults to --release
flutter build ios
# make folder, add .app then zip it and rename it to .ipa
mkdir -p Payload
@monmonja
monmonja / ViewExtensions.kt
Created April 26, 2016 15:29
Example of view related kotlin extension in android
package com.tutorialforandroid.testing
import android.content.Intent
import android.net.Uri
import android.support.v4.app.Fragment
import android.support.v4.app.FragmentActivity
import android.support.v4.app.FragmentManager
import android.support.v7.app.AppCompatActivity
import com.tutorialforandroid.testing.ui.MainActivityUI
@monmonja
monmonja / FontUtils.java
Last active September 22, 2015 01:17
Extending Components and AppTheme with Material Design
package com.monmonja.tutorial;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Typeface;
import android.widget.TextView;
/**
* tutorial at http://www.tutorialforandroid.com/2015/03/extending-components-and-apptheme-with.html
*/
package com.monmonja.tutorial;
import android.app.Dialog;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.DialogFragment;
import android.view.View;
import android.view.ViewGroup;