Skip to content

Instantly share code, notes, and snippets.

View abhishekbhalani's full-sized avatar
🎄
working on latest framework...

Abhishek B. abhishekbhalani

🎄
working on latest framework...
View GitHub Profile
@BrandonSmith
BrandonSmith / AndroidManifest.xml
Last active July 19, 2023 19:11
Quick example of how to schedule a notification in the future using AlarmManager
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.cards.notification">
<uses-sdk
android:minSdkVersion="17"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
@jansanchez
jansanchez / gist:6694824
Created September 25, 2013 03:23
How do I store an array of objects in a cookie with jQuery $.cookie()?
/*
Cookies can only store strings. Therefore, you need to convert your array of objects into a JSON string.
If you have the JSON library, you can simply use JSON.stringify(people) and store that in the cookie,
then use $.parseJSON(people) to un-stringify it.
In the end, your code would look like:
*/
var people = [
{ 'name' : 'Abel', 'age' : 1 },
{ 'name' : 'Bella', 'age' : 2 },
@PaulGreenwell
PaulGreenwell / C# ToJson extension class
Created September 25, 2013 04:20
Sample C# extension to serialise a class to JSON
using System.IO;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
public static class JsonExtensions
{
public static string ToJson(this object entity)
{
var serializer = new JsonSerializer();
serializer.Converters.Add(new StringEnumConverter());
@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)
@rcotrina94
rcotrina94 / How to use Images as Radio buttons.md
Last active January 30, 2025 09:22
How to use images for radio buttons (input-radio).
@brendanzagaeski
brendanzagaeski / XShellUninstallVS.txt
Created December 14, 2013 00:18
Fixing the Xamarin installation after uninstalling the "Xamarin Shell" extension from "Tools -> Extensions and Updates" in Visual Studio
If you uninstall the "Xamarin Shell" extension from "Tools -> Extensions and Updates" in Visual Studio, you will get a "'ShellPackage' package did not load correctly" error even after uninstalling and re-installing both Xamarin VS extensions.
## Cause
Uninstalling the "Xamarin Shell" from "Tools -> Extensions and Updates" sets a value on [1] named "Mono.VisualStudio.Shell,1.0", with the data:
C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO 12.0\COMMON7\IDE\EXTENSIONS\XAMARIN\SHELL\1.0.0\
[1] Computer\HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\12.0\ExtensionManager\PendingDeletions
@Boztown
Boztown / ImageProcessingUtility.cs
Last active July 19, 2019 10:47
Here's a little function in C# to resize an image with proportional constraints. Just specific the max width and max height and this method will return a bitmap all sized up for you. I have this snipped in the form of a static **Utilities** class because that's how I use it.
using System;
using System.Collections.Generic;
using System.Drawing.Drawing2D;
using System.Drawing.Imaging;
using System.Linq;
using System.Web;
using System.Drawing;
namespace Utilities
{
@mkaminsky11
mkaminsky11 / download.js
Last active October 20, 2022 12:17
How to manipulate Google Drive files
/*
Download a file
*/
function downloadFile(fileId) {
var request = gapi.client.drive.files.get({
'fileId': fileId
});
request.execute(function(resp) {
window.location.assign(resp.webContentLink);
});
@neilgee
neilgee / socialmenu.html
Last active March 28, 2021 23:21
FontAwesome Social Media Menu
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css" rel="stylesheet">
<style>
.social-menu {
display: flex;
list-style-type: none;
}
.social-menu i {
color: #fff;
@imranbaloch
imranbaloch / gist:10895917
Created April 16, 2014 15:40
SqlHelper.cs class with async support
// ===============================================================================
// Microsoft Data Access Application Block for .NET
// http://msdn.microsoft.com/library/en-us/dnbda/html/daab-rm.asp
//
// cs
//
// This file contains the implementations of the SqlHelper and SqlHelperParameterCache
// classes.
//
// For more information see the Data Access Application Block Implementation Overview.