Skip to content

Instantly share code, notes, and snippets.

View cab404's full-sized avatar
💜
s p a r k l i n g u n i c o r n p r i n c e s s ™

Cabia Rangris cab404

💜
s p a r k l i n g u n i c o r n p r i n c e s s ™
View GitHub Profile
#!/bin/bash
IFS=$'\n';
echo "Moving tree to temporary folder"
for A in $(find -type f); do
mkdir -p .resort/$(dirname $A);
mv "$A" ".resort/$A";
done
echo "Restoring tree structure, applying sorting"
```
1,Барнаул,83.3456677,53.0976202,83.9072622,53.5046367
2,Брянск,34.1922357,53.1838365,34.7031279,53.374557
3,Волгоград,44.1092631,48.4132431,44.6839126,48.8894991
4,Волжский,44.6489811,48.7241632,44.8865116,48.9309656
5,Воронеж,39.0137772,51.4853846,39.4582951,51.8732697
6,Дзержинск,43.3424382,56.2124091,43.7615592,56.3302443
7,Екатеринбург,60.3851198,56.6678841,60.8421559,56.9631816
8,Ижевск,53.0099999,56.7236,53.3925998,57.0025341
9,Иркутск,95.6472077743,51.130399612,119.1389219501,64.3217050868
@cab404
cab404 / android-icons.sh
Last active October 7, 2016 17:30
Simple tool for converting multiple icons for Android app
#/bin/bash
#@author cab404
MUL=24
if [[ $1 != "" ]]; then
MUL=$1
fi
# Simple tool for converting multiple icons fo Android app
import android.content.Context;
import android.graphics.Canvas;
import android.util.AttributeSet;
import android.widget.TextView;
/**
* Width resizing text view
*
* @author cab404
*/
@cab404
cab404 / EAN13.java
Last active December 15, 2016 02:07
/**
* Generates EAN13 barcode data
*
* @author cab404
*/
public class EAN13 {
public static final int[] INDENTS = {0, 2, 44, 46, 92, 94};
public static final int LENGTH = 95;
private final static byte[][] CODEMAP =
package com.cab404.moblightlevel;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.EntityPlayerSP;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.EnumSkyBlock;
import net.minecraft.world.World;
import net.minecraftforge.client.event.RenderWorldLastEvent;
import net.minecraftforge.common.MinecraftForge;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;
import java.nio.CharBuffer;
import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
@cab404
cab404 / BlockingOverscrollView.java
Created March 29, 2017 14:42
Makes getting overscroll value from ListViews and other scrollables easy
package ru.mos.portal.android.design;
import android.content.Context;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.view.MotionEventCompat;
import android.support.v4.view.ViewCompat;
import android.util.AttributeSet;
import android.util.Log;
import android.view.MotionEvent;
@cab404
cab404 / Clusters.java
Created May 18, 2017 11:39
Simple greedy clustering algorithm supporting both directions of clustering
import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
/**
* @author cab404
*/
public class Clusters<A> {
package com.cab404.testing
import io.socket.client.IO
import io.socket.client.Socket
import org.json.JSONObject
import java.io.FileWriter
import java.lang.Long
import java.text.SimpleDateFormat
import java.time.Instant
import java.util.*