Skip to content

Instantly share code, notes, and snippets.

View aviadmini's full-sized avatar

aviadmini

  • Always moving
View GitHub Profile
@kontez
kontez / freeotp_backup.md
Created January 4, 2018 14:27 — forked from jleclanche/freeotp_backup.md
A guide to back up and recover 2FA tokens from FreeOTP (Android)

Backing up and recovering 2FA tokens from FreeOTP

Backing up FreeOTP

Using adb, create a backup of the app using the following command:

adb backup -f freeotp-backup.ab -apk org.fedorahosted.freeotp
@lukechilds
lukechilds / get_latest_release.sh
Created August 9, 2016 19:43
Shell - Get latest release from GitHub
get_latest_release() {
curl --silent "https://api.github.com/repos/$1/releases/latest" | # Get latest release from GitHub api
grep '"tag_name":' | # Get tag line
sed -E 's/.*"([^"]+)".*/\1/' # Pluck JSON value
}
# Usage
# $ get_latest_release "creationix/nvm"
# v0.31.4
@tinmegali
tinmegali / CircularFragReveal.java
Last active March 15, 2019 10:28
Add a circular Reveal and Unreveal transition animation to a Android Fragment
import android.animation.Animator;
import android.animation.TimeInterpolator;
import android.annotation.TargetApi;
import android.graphics.Color;
import android.os.Build;
import android.support.annotation.NonNull;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewAnimationUtils;
@manuerumx
manuerumx / postJSON.cs
Last active October 20, 2021 05:39
Unity 3D example POST JSON Data to a Server with http Auth
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class goLevel : MonoBehaviour {
//With the @ before the string, we can split a long string in many lines without getting errors
private string json = @"{
'hello':'world',
'foo':'bar',
'count':25
@DanDiplo
DanDiplo / JS-LINQ.js
Last active April 29, 2024 10:30
JavaScript equivalents of some common C# LINQ methods. To help me remember!
// JS array equivalents to C# LINQ methods - by Dan B.
// First: This version using older JavaScript notation for universal browser support (scroll down for ES6 version):
// Here's a simple array of "person" objects
var people = [
{ name: "John", age: 20 },
{ name: "Mary", age: 35 },
{ name: "Arthur", age: 78 },
{ name: "Mike", age: 27 },
/*
* Copyright (C) 2014 Jared Rummler <jared.rummler@gmail.com>
*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@borodean
borodean / script.py
Last active October 31, 2021 14:21
FontForge Single Character Font
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# fontforge -lang=py -script script.py
import fontforge
font = fontforge.font()
font.encoding = 'UnicodeFull'
font.design_size = 16

Font Face

A mixin for writing @font-face rules in SASS.

Usage

Create a font face rule. Embedded OpenType, WOFF2, WOFF, TrueType, and SVG files are automatically sourced.

@include font-face(Samplino, fonts/Samplino);
@JMPergar
JMPergar / FlipPageViewTransformer.java
Last active November 7, 2019 05:33
Flip animation for ViewPager
import android.support.v4.view.ViewPager;
import android.view.View;
public class FlipPageViewTransformer implements ViewPager.PageTransformer {
@Override
public void transformPage(View page, float position) {
float percentage = 1 - Math.abs(position);
page.setCameraDistance(12000);
setVisibility(page, position);
setTranslation(page);
@fernferret
fernferret / SteamOpenID.java
Last active January 12, 2023 03:06
Steam OpenID Authentication in Java
package com.fernferret.steambot.web;
import org.openid4java.association.AssociationException;
import org.openid4java.consumer.ConsumerException;
import org.openid4java.consumer.ConsumerManager;
import org.openid4java.consumer.VerificationResult;
import org.openid4java.discovery.DiscoveryException;
import org.openid4java.discovery.DiscoveryInformation;
import org.openid4java.discovery.Identifier;
import org.openid4java.message.AuthRequest;