Skip to content

Instantly share code, notes, and snippets.

View sadegh's full-sized avatar
🎯
Focusing

Sadegh sadegh

🎯
Focusing
View GitHub Profile
@NightlyNexus
NightlyNexus / AmazonS3RequestFactory.java
Created March 11, 2017 20:34
Creates okhttp3.Requests for uploading files to an Amazon S3 storage bucket. Implements https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-authentication-HTTPPOST.html
import java.io.File;
import java.io.IOException;
import java.nio.charset.Charset;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import java.util.TimeZone;
import okio.BufferedSource;
import okio.ByteString;
@hamidazimy
hamidazimy / rtl_jira.user.js
Last active November 13, 2015 08:22
Tiny script to add RTL support to JIRA (can be used everywhere with a little modification)
// ==UserScript==
// @name RTL Jira
// @namespace medianesh.com:9090
// @include http://medianesh.com:9090/*
// @version 0.2
// @grant none
// ==/UserScript==
function isRTL(text) {
if (text !== "") {
@hamidazimy
hamidazimy / rtl_slack.user.js
Last active August 26, 2018 15:30
Tiny script to add RTL support to slack.com (can be used everywhere with a little modification)
// ==UserScript==
// @name RTL Slack
// @namespace slask.com
// @include https://*.slack.com/*
// @version 1.2.2
// @grant none
// ==/UserScript==
function isRTL(text) {
if (text !== "") {
@tastywheat
tastywheat / rxpy-create-observable.py
Created July 28, 2015 01:39
rxpy create observable
from tornado import gen, ioloop
from rx import Observable
def create_observable(observer):
observer.on_next(50)
observer.on_next(2)
observer.on_next(8)
@joshdholtz
joshdholtz / SomeFragment.java
Last active December 22, 2022 09:41
Android Google Maps V2 - MapView in XML
public class SomeFragment extends Fragment {
MapView mapView;
GoogleMap map;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.some_layout, container, false);
@neuro-sys
neuro-sys / BCD.java
Last active May 15, 2024 12:11
BCD Conversion in java
/*
* Copyright 2010 Firat Salgur
* Improved by Abdallah Abdelazim
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>