Skip to content

Instantly share code, notes, and snippets.

@HenokT
HenokT / FlipAnimation.kt
Created April 27, 2024 04:10 — forked from vishal2376/FlipAnimation.kt
Card Flip Animation using Jetpack Compose
package com.vishal2376.animations.ui.theme
import androidx.compose.animation.animateColorAsState
import androidx.compose.animation.core.EaseInOut
import androidx.compose.animation.core.animateFloatAsState
import androidx.compose.animation.core.tween
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
@HenokT
HenokT / page-info.ts
Created August 13, 2021 17:41 — forked from quangpl/page-info.ts
NestJS Graphql Cursor Based pagination
import { ObjectType, Field } from "@nestjs/graphql";
@ObjectType()
export class PageInfo {
@Field({ nullable: true })
startCursor: string;
@Field({ nullable: true })
endCursor: string;
@HenokT
HenokT / notes
Created January 30, 2016 22:26
Boot2Docker v1.9.1 issue with AUFS.
(docker-vm) Boot2Docker v1.9.1 has a known issue with AUFS.
(docker-vm) See here for more details: https://github.com/docker/docker/issues/18180
(docker-vm) Consider specifying another storage driver (e.g. 'overlay') using '--engine-storage-driver' instead.

Useful git commands

  • Sort branches by committerdate (DESC)

    git branch --sort=-committerdate

  • push local branch to remote and setup the local branch to track remote branch

    git push -u origin <branch>

@HenokT
HenokT / google-places-autocomplete-directive.coffee
Last active September 1, 2015 04:09
AngularJS directive for address autocompletion using Google Places Autocomplete API
###
This directive is based on an example on google's developers website that shows how to use
the places api to implement an address autocomplete textbox:
https://developers.google.com/maps/documentation/javascript/examples/places-autocomplete-addressform
Here is an example of how to use it in your application:
<html ng-app="your-app">
<head>
scp username@remotehost:"~/mydir/{lib1-*.jar,lib2-*.jar}" .
@HenokT
HenokT / GenericAsyncTaskLoader.java
Last active February 27, 2018 03:17
An example of a Generic AsyncTaskLoader for Android
package com.yourcompany.util;
import android.content.Context;
import android.support.v4.content.AsyncTaskLoader;
import android.util.Log;
import com.yourcompany.util.GenericAsyncTaskLoader.ServiceData;
/**
* A generic Loader that delegates its actual loading operation to a
* CustomLoaderCallbacks<T> instance passed through the constructor.
@HenokT
HenokT / Bash extended glob support
Created December 5, 2013 16:47
Bash extended glob support
In addition to the traditional globs (supported by all Bourne-family shells), Bash (and Korn Shell) offer extended globs, which have the expressive power of regular expressions. Korn shell enables this by default; in Bash, you can enable it using a command:
> shopt -s extglob
and disbale it using:
> shopt -u extglob
Example:
@HenokT
HenokT / GenericUdpListener.java
Last active December 30, 2015 06:39
A Generic UDP Listener that can be configured to listen to UDP messages on any port and pass the messages to a MessageHandler<T> instance for processing .The default packet bufferSize can be overridden by using the constructor that takes a bufferSize argument.
package com.yourcompany.util;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.util.concurrent.Executor;
public class GenericUdpListener implements Runnable
{
private static final int ZERO = 0;
private int port;