Skip to content

Instantly share code, notes, and snippets.

View larikraun's full-sized avatar

Omolara Adejuwon larikraun

View GitHub Profile
@larikraun
larikraun / build.gradle.kts
Created April 9, 2021 10:44 — forked from mileskrell/build.gradle.kts
Example of declaring Android signing configs using Gradle Kotlin DSL
android {
signingConfigs {
getByName("debug") {
keyAlias = "debug"
keyPassword = "my debug key password"
storeFile = file("/home/miles/keystore.jks")
storePassword = "my keystore password"
}
create("release") {
keyAlias = "release"
@larikraun
larikraun / Nigerian States
Created March 9, 2017 04:31
This is a list of Nigerian states as a string array in Android
<string-array name="states">
<item>Abia State</item>
<item>Adamawa State</item>
<item>Akwa Ibom State</item>
<item>Anambra State</item>
<item>Bauchi State</item>
<item>Bayelsa State</item>
<item>Benue State</item>
<item>Borno State</item>
<item>Cross River State</item>
<?php
mysql_connect("localhost", "root", "yourpassword");
mysql_select_db("test");
require_once('sphinxapi.php');
$s = new SphinxClient;
$s->setServer("127.0.0.1", 9312); // NOT "localhost" under Windows 7!
$s->setMatchMode(SPH_MATCH_ANY);
$s->SetLimits(0, 25);
$q=$_GET["q"];
$result = $s->Query($q);
@larikraun
larikraun / AmazonS3
Created February 11, 2017 18:08
Snippet to Connect to Amazon S3
String filePath = "PATH_TO_FILE"; // the path of the image/path you want to upload.
File file = new File(filePath);
String MY_PICTURE_BUCKET = "BUCKET_NAME"; //the name of the bucket you want to create. This name must be unique
String MY_IDENTITY_POOL_ID = "IDENTITY_POOL_ID"; //the id you just got from cognito console.
CognitoCachingCredentialsProvider credentialsProvider = new CognitoCachingCredentialsProvider(
MainActivity.this, // Application Context
MY_IDENTITY_POOL_ID, // Identity Pool ID
@larikraun
larikraun / gist:326208f9249c86a59f9c397cdc6f05d1
Created January 26, 2017 13:29 — forked from segebee/gist:7dde9de8e70a207e6e19
Nigeria States and Local Government Areas JSON - codingsavvy.com
[{"state":{"name":"Abia State","id":1,"locals":[{"name":"Aba South","id":1},{"name":"Arochukwu","id":2},{"name":"Bende","id":3},{"name":"Ikwuano","id":4},{"name":"Isiala Ngwa North","id":5},{"name":"Isiala Ngwa South","id":6},{"name":"Isuikwuato","id":7},{"name":"Obi Ngwa","id":8},{"name":"Ohafia","id":9},{"name":"Osisioma","id":10},{"name":"Ugwunagbo","id":11},{"name":"Ukwa East","id":12},{"name":"Ukwa West","id":13},{"name":"Umuahia North","id":14},{"name":"Umuahia South","id":15},{"name":"Umu Nneochi","id":16}]}},{"state":{"name":"Adamawa State","id":2,"locals":[{"name":"Fufure","id":1},{"name":"Ganye","id":2},{"name":"Gayuk","id":3},{"name":"Gombi","id":4},{"name":"Grie","id":5},{"name":"Hong","id":6},{"name":"Jada","id":7},{"name":"Lamurde","id":8},{"name":"Madagali","id":9},{"name":"Maiha","id":10},{"name":"Mayo Belwa","id":11},{"name":"Michika","id":12},{"name":"Mubi North","id":13},{"name":"Mubi South","id":14},{"name":"Numan","id":15},{"name":"Shelleng","id":16},{"name":"Song","id":17},{"name":"Toung
@larikraun
larikraun / .gitignore
Created March 24, 2016 03:59 — forked from octocat/.gitignore
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@larikraun
larikraun / strong-passwords.php
Created March 1, 2016 15:00 — forked from tylerhall/strong-passwords.php
A user friendly, strong password generator PHP function.
<?PHP
// Generates a strong password of N length containing at least one lower case letter,
// one uppercase letter, one digit, and one special character. The remaining characters
// in the password are chosen at random from those four sets.
//
// The available characters in each set are user friendly - there are no ambiguous
// characters such as i, l, 1, o, 0, etc. This, coupled with the $add_dashes option,
// makes it much easier for users to manually type or speak their passwords.
//
// Note: the $add_dashes option will increase the length of the password by
<?php
/**
* Created by PhpStorm.
* User: Omolara Adejuwon
* Date: 18/11/2015
* Time: 11:10
*/
require_once("./db_function.php");
@larikraun
larikraun / DumpIndex.java
Last active September 17, 2015 12:11 — forked from luisparravicini/DumpIndex.java
Dumps a Lucene index as a XML document.
import java.io.File;
import java.io.IOException;
import java.util.List;
import javax.xml.stream.FactoryConfigurationError;
import javax.xml.stream.XMLOutputFactory;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamWriter;
import org.apache.lucene.document.Document;