Skip to content

Instantly share code, notes, and snippets.

@AizazZaidee
AizazZaidee / Android Volley 2015-01-15 Multipart Request with Upload Progress
Last active July 9, 2018 03:11
Android Volley 2015-01-15 Multipart Request with Upload Progress
package com.az.custom.request;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FilterOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
import java.util.HashMap;
import java.util.Map;
// Created by Nick Snyder on 11/13/12.
// https://gist.github.com/nicksnyder/4075682
// http://stackoverflow.com/questions/12927027/uicollectionview-flowlayout-not-wrapping-cells-correctly-ios
// NDCollectionViewFlowLayout.h
@interface NDCollectionViewFlowLayout : UICollectionViewFlowLayout
@end
@skl
skl / PopSheet.swift
Created June 19, 2020 01:08
This is a workaround for iPad ActionSheets disappearing off the screen.
//
// PopSheet.swift
//
// Adapted from:
// https://stackoverflow.com/questions/56910941/present-actionsheet-in-swiftui-on-ipad
//
import SwiftUI
extension View {
@kjoconnor
kjoconnor / delete_snapshots.py
Created November 6, 2013 21:33
boto script to delete snapshots matching a filter and older than X days
import sys
from boto.ec2 import connect_to_region
from datetime import datetime, timedelta
try:
days = int(sys.argv[1])
except IndexError:
days = 7
@jubinjacob19
jubinjacob19 / ui_test_sharder.py
Created July 3, 2020 05:56
Python Script to shard UITests in Xcode project
import os
import errno
import sys
shard_index = sys.argv[1]
PATH = os.path.dirname(os.getcwd())
TESTSPATH = os.path.join(PATH,"Example/UITests/")
tests = []
shard_tests = ""
@guillermomuntaner
guillermomuntaner / CutCopyPaste.java
Last active December 11, 2022 03:24
EditText which notifies of Cut, Copy and Paste events via an attachable listener
import android.content.Context;
import android.util.AttributeSet;
import android.widget.EditText;
/**
* Original:
* An EditText, which notifies when something was cut/copied/pasted inside it.
* @author Lukas Knuth
* @version 1.0
*
// https://inteist.com/git-remove-pods-folder-from-pushed-repository-how-to/
git filter-branch --index-filter 'git rm --cached --ignore-unmatch Pods/*' --tag-name-filter cat -- --all
git push --force
@tombowers
tombowers / delete-with-select.cs
Last active March 8, 2023 04:32
Entity Framework - Update without Select
var id = 1;
using (var db = new entityContext())
{
// Select entity
var entity = db.dbset.FirstOrDefault(e => e.ID == id);
if (entity != null)
{
// Remove Entity
db.dbset.Remove(entity);
db.SaveChanges();
@anggadarkprince
anggadarkprince / AppHelper.java
Last active May 2, 2023 22:39
Upload file with Multipart Request Volley Android
import android.graphics.Bitmap;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import java.io.ByteArrayOutputStream;
/**
* Sketch Project Studio
* Created by Angga on 12/04/2016 14.27.
*/
public class AppHelper {
@Robyer
Robyer / maven-publish-helper-usage.gradle
Last active June 15, 2023 04:22
Gradle script for publishing Android library with sources and javadoc to Maven repository using maven-publish plugin.
// You can use maven-publish-helper.gradle script without changes and even share it between multiple
// modules. Just place the maven-publish-helper.gradle file in the root directory of your project,
// then apply it at the bottom of your module's build.gradle file like this:
// ...content of module's build.gradle file...
apply from: '../maven-publish-helper.gradle'
publishing {
publications {