Skip to content

Instantly share code, notes, and snippets.

View frankodoom's full-sized avatar
:octocat:

Frank Arkhurst Odoom frankodoom

:octocat:
View GitHub Profile
@mombrea
mombrea / ThreadedComments.java
Created July 15, 2014 14:49
Threaded Comments
public static List<Comment> toThreadedComments(List<Comment> comments){
//comments should be sorted by date first
//The resulting array of threaded comments
List<Comment> threaded = new ArrayList<Comment>();
//An array used to hold processed comments which should be removed at the end of the cycle
List<Comment> removeComments = new ArrayList<Comment>();
@kostiakoval
kostiakoval / PrefUtils.java
Created March 29, 2014 15:49
SharedPreferences util
import android.content.Context;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
public class PrefUtils {
/**
* Called to save supplied value in shared preferences against given key.
* @param context Context of caller activity
@iamarcel
iamarcel / Structuring Neat .NET Core Command Line Apps Neatly.org
Created September 7, 2016 07:30
Structuring Neat .NET Core Command Line Apps Neatly
@trailmax
trailmax / AzureStorageApi
Last active March 10, 2021 11:02
Unit testing the functionality to upload files to Azure Blob Storage via REST API. For blog post: http://tech.trailmax.info/2013/11/how-to-test-code-for-accessing-azure-storage-rest-api/ Please note, this implementation only supports file up to 64Mb in size. Anything larger and you need to chop files in pieces and upload them separately. There i…
using System;
using System.Collections.Generic;
using System.IO;
using System.Net.Http;
namespace PackageUploader.Azure
{
public class AzureStorageApi
{
public void UploadFile(String fullFilePath, String blobSasUri, Dictionary<String, String> metadata = null)
@rtyler
rtyler / upload-to-azure.sh
Created January 4, 2018 19:22
A bash script which supports uploading blobs to Azure Storage: ./upload-to-azure.sh [filename]
#!/usr/bin/env bash
FILENAME=${1}
# expected to be defined in the environment
# - AZURE_STORAGE_ACCOUNT
# - AZURE_CONTAINER_NAME
# - AZURE_ACCESS_KEY
# inspired by
@iamarcel
iamarcel / Creating Neat .NET Core Command Line Apps.md
Last active November 28, 2023 10:41
Creating Neat .NET Core Command Line Apps

Creating Neat .NET Core Command Line Apps

You can now read this on my (pretty) website! Check it out here.

Every reason to get more HackerPoints™ is a good one, so today we're going to write a neat command line app in .NET Core! The Common library has a really cool package Microsoft.Extensions.CommandlineUtils to help us parse command line arguments and structure our app, but sadly it's undocumented.

No more! In this guide, we'll explore the package and write a really neat

@benjamine
benjamine / alias.cmd
Last active February 19, 2024 15:49
Aliases for windows command line
::
:: Aliases for windows command line
::
:: Installation:
::
:: - create a folder for your aliases (eg: ```c:\cmd-aliases```)
:: - add that folder to your PATH variable
:: - save this script as setalias.cmd on that folder
:: - run "alias" to see usage
::
@velizarn
velizarn / sendgrid.bash
Last active March 12, 2024 13:13
Send email from bash script by using SendGrid API
#!/bin/bash
SENDGRID_API_KEY=""
EMAIL_TO=""
FROM_EMAIL=""
FROM_NAME=""
SUBJECT=""
bodyHTML="<p>Email body goes here</p>"
@jwo
jwo / mysql.database.yml
Last active March 28, 2024 15:32
Sample config/database.yml from Rails. Postgres, MySQL, and SQLite
#
# Install the MYSQL driver
# gem install mysql2
#
# Ensure the MySQL gem is defined in your Gemfile
# gem 'mysql2'
#
# And be sure to use new-style password hashing:
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
development:
@subfuzion
subfuzion / curl.md
Last active April 26, 2024 09:43
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.