Skip to content

Instantly share code, notes, and snippets.

View xiprox's full-sized avatar

İhsan Işık xiprox

View GitHub Profile
@xiprox
xiprox / make_drawable_configuration.sh
Last active November 4, 2015 13:55
Android Drawable Animation Configuration Generator – A simple script for easily creating configuration xml files for drawable animations in android
#!/bin/bash
SCRIPT_CONFIGURED=false # CHANGE THIS TO TRUE ONCE YOU MAKE YOUR CHANGES
DRAWABLE_NAME="rocket_animation" # Name of final drawable
FRAME_PREFIX="rocket_animation_" # Prefix in the names of each frame under your res/drawable folder
FRAME_NUMBER=100 # Number of frames the animation has
FRAME_DURATION=200 # Duration of a single frame (in milliseconds)
ONESHOT="false" # Animation plays only once if this is set true
@xiprox
xiprox / ViewBasedRadiusShowcaseDrawer.java
Created January 2, 2016 13:37
A ShowcaseDrawer that draws showcase circle with the greater side of a view divided by 2 as its radius value.
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffXfermode;
import android.view.View;
import com.github.amlcurran.showcaseview.MaterialShowcaseDrawer;

Keybase proof

I hereby claim:

  • I am xiprox on github.
  • I am xip (https://keybase.io/xip) on keybase.
  • I have a public key whose fingerprint is 9F09 979D 164A 6500 5618 0EBD A929 33E5 5BCA FEF1

To claim this, I am signing this object:

@xiprox
xiprox / desktop-switch
Last active February 21, 2018 13:14
Various AutoHotkey scripts I use for stuff like media controls on a keyboard without the keys, Recycle Bin clearance, quick cmd, desktop switching, etc...
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
NumpadDot & NumpadDiv::Send ^#{Left}
NumpadDot & NumpadMult::Send ^#{Right}
@xiprox
xiprox / Dart Class
Last active September 11, 2018 16:38
Flutter IntelliJ File Templates
class ${ClassName} {
${ClassName}();
}
@xiprox
xiprox / import_one_signal_into_customerio.dart
Last active June 3, 2022 09:08
Import devices from OneSignal into Customer.io and convert APNS tokens to FCM.
/// Script used to import user devices (notification tokens) from
/// OneSignal into Customer.io. In the process, it converts APNS
/// tokens to FCM tokens.
///
/// See:
/// - https://www.thepolyglotdeveloper.com/2017/06/apns-tokens-fcm-tokens-simple-http
/// - https://developers.google.com/instance-id/reference/server#create_registration_tokens_for_apns_tokens
/// - https://www.customer.io/docs/api/#operation/add_device
import 'dart:convert';
@xiprox
xiprox / open_ai_api.dart
Last active January 23, 2024 11:15
OpenAI TTS chunked transfer streaming dart (not working on web)
import 'dart:convert';
import 'package:universal_io/io.dart';
import 'package:http/http.dart' as http;
import 'dart:typed_data';
const _kOpenAiApiKey = 'sk-QDU...';
abstract interface class OpenAiApi {