Skip to content

Instantly share code, notes, and snippets.

TheDumbTechGuy thedumbtechguy

  • Wildcard Technologies
  • Accra, Ghana
Block or report user

Report or block thedumbtechguy

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
@thedumbtechguy
thedumbtechguy / USSDSimulator.html
Created Jan 30, 2019
A simple USSD simulator using fetch, prompt and alert. Can be easily adapted to any spec.
View USSDSimulator.html
<input type="text" id="phone" placeholder="0200672215" />
<button class="btn" id="sendBtn">Send</button>
<script>
var input = document.getElementById('phone');
var makeRequest = function(messageType, sessionId, message) {
@thedumbtechguy
thedumbtechguy / App.elm
Last active Jul 9, 2017
Elm Parent Child Communication
View App.elm
module App exposing (Model, initialModel, update, view)
import Html exposing (..)
import Login as Login
type alias Model =
{ loginModel : Login.Model
, pressCount : Int
}
@thedumbtechguy
thedumbtechguy / debug.yml
Created May 3, 2017
'ansible.vars.unsafe_proxy.AnsibleUnsafeText object' has no attribute
View debug.yml
[{
u 'username': u 'ptadmin',
u 'password': AnsibleVaultEncryptedUnicode($ANSIBLE_VAULT; 1.1; AES256\ n32656663616338666438643633366564383461386435626139353766313766306435346633376435\ n3962326635646666333935306334346561636564343239310a373630626132396632303736613861\ n30383361386364656435393330333131373531343030313430663266633233383464323533313737\ n3330393362306265300a353036393636353035303439666637633339626138626164303532633464\ n3135\ n),
u 'use_sudo': True,
u 'use_ssh': False
}, {
u 'username': u 'ansibleremote',
u 'public_key': AnsibleVaultEncryptedUnicode($ANSIBLE_VAULT; 1.1; AES256\ n66383966626637393239373434313261393234666233386165326230623034373762636438363464\ n6162386434643364376136356335663933633664376339610a393734653236316330336162653131\ n38633336333864633930363039326334323863353062313037653566663234326465336636323035\ n6561373463636337320a356361343062633630356136613130633562613830303162316138356531\ n33646536666165356334336465313531646465393632336133376236323565643731356
@thedumbtechguy
thedumbtechguy / ansible_semaphore_ubuntu.md
Last active Aug 21, 2019
Install Ansible Semaphore on Ubuntu
View ansible_semaphore_ubuntu.md

Ansible Installation

Ansible is a powerful configuration management tool that we use in managing our infrastructure and applications.

It requires a centralized Control server and can connect to hosts over an array of connection types including SSH.

Controller Setup

The Ansible controller will run our playbooks. This needs both Ansible and Semaphore (web based management console) setup.

@thedumbtechguy
thedumbtechguy / nationality.html
Created Dec 5, 2016 — forked from didats/nationality.html
Nationality List in HTML Dropdown
View nationality.html
<select name="nationality">
<option value="">-- select one --</option>
<option value="afghan">Afghan</option>
<option value="albanian">Albanian</option>
<option value="algerian">Algerian</option>
<option value="american">American</option>
<option value="andorran">Andorran</option>
<option value="angolan">Angolan</option>
<option value="antiguans">Antiguans</option>
<option value="argentinean">Argentinean</option>
@thedumbtechguy
thedumbtechguy / FolioGlidePage
Created May 19, 2016
A Folio Page that supports using Glide
View FolioGlidePage
import android.support.annotation.StringRes;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import com.bumptech.glide.RequestManager;
import com.bumptech.glide.manager.Lifecycle;
import com.bumptech.glide.manager.LifecycleListener;
@thedumbtechguy
thedumbtechguy / AndroidEncryptedMP3LocalHTTPServer.java
Last active Apr 28, 2018
A Local HTTP Streaming Server (LocalHTTPServer) for Android. This version was specifically made to stream encrypted MP3 files using a CipherInputStream to MediaPlayer but should be easily modified to work on ordinary files. It has been tested on API 9+ and works fine on large files (tested on up to 20MB files) and also supports range requests. I…
View AndroidEncryptedMP3LocalHTTPServer.java
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.EOFException;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
@thedumbtechguy
thedumbtechguy / Decrypt.java
Last active Dec 1, 2018
RSA Encrypt in PHP and Decrypt in Java (Android)
View Decrypt.java
---Java
//I used this on Android
//before you proceed, you need to ensure your private key is PKCS8 since that is what can be read natively in java.
//If your key begins with -----BEGIN RSA PRIVATE KEY-----, the it is ssleay and you need to convert it using the openssl command below
//openssl pkcs8 -topk8 -inform pem -in ssleay-private-key.key -outform pem -nocrypt -out pkcs8-private-key.pem
final private static String RSA_PRIVATE_KEY =
"-----BEGIN PRIVATE KEY-----\n" +
"MI...\n" +
@thedumbtechguy
thedumbtechguy / SearchAdapter.java
Last active Aug 29, 2015
Android ListView Adapter To Display Different Views
View SearchAdapter.java
package com.whisppa.app.adapter;
import android.app.Activity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.crashlytics.android.Crashlytics;
import com.whisppa.app.BaseActivity;
import com.whisppa.app.R;
@thedumbtechguy
thedumbtechguy / gist:23c9c88592723e8b2811
Last active Aug 29, 2015
Handling focus in Android media player
View gist:23c9c88592723e8b2811
@Override
public void onPrepared(MediaPlayer mediaPlayer) {
mIsPrepared = true;
isLoadingNew = false;
mLostFocus = false;
if (startFocus() == AudioManager.AUDIOFOCUS_REQUEST_GRANTED) {
initForeground();
You can’t perform that action at this time.