Skip to content

Instantly share code, notes, and snippets.

View florinmuscalu's full-sized avatar
😅
I may be slow to respond.

Zekon Technologies florinmuscalu

😅
I may be slow to respond.
View GitHub Profile
package ro.florinm.simplepianokeyboard;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.RectF;
import android.os.Handler;
import android.os.Message;
import android.support.v4.view.MotionEventCompat;
@florinmuscalu
florinmuscalu / KeyboardViewSmall.java
Created July 8, 2019 09:10
KeyboardViewSmall snippet
@Override
protected void onDraw(Canvas canvas) {
for (int i=0; i < GlobalVars.getInstance().WHITE_COUNT; i++) {
canvas.drawRect(whites.get(i).rect, i == 23 ? downKeyColor : whiteKeyColor);
canvas.drawLine(whites.get(i).rect.left, top_pad, whites.get(i).rect.left, height, blackLineColor);
}
canvas.drawLine(0, top_pad, width, top_pad, blackLineColor);
canvas.drawLine(0, height, width, height, blackLineColor);
for (Key k : blacks) {
123
aa
aaaa
aaaaaaa
bbbb
cc
ccccc
cccccclast
dddd
djgfk
sed -n "/aa/,/cc/p" test.txt
start="aa"
end="cc"
end=$(grep "$end" text.txt | tail -1)
sed -n "/$start/,/$end/p" test.txt
@florinmuscalu
florinmuscalu / AudioSoundPlayer.java
Last active November 17, 2019 23:58
AudioSoundPlayer.java
package ro.florinm.simplepianokeyboard;
import android.content.Context;
import android.media.AudioAttributes;
import android.media.MediaPlayer;
import android.media.SoundPool;
import android.util.SparseArray;
public class AudioSoundPlayer {
@florinmuscalu
florinmuscalu / .json
Created December 5, 2020 15:17
JSON question file
{
"q1":{"q":"2 to the 10th?", "a":"1024"},
"q2":{"q":"Value of PI?", "a":"3.14"}
}
@florinmuscalu
florinmuscalu / .html
Created December 5, 2020 15:21
Using Easy Flashcards
[easyfc title="General knowledge" file="flashcards/general_k.txt"/]
<TextView
android:id="@+id/test_text"
style="?attr/TextViewStyle"
android:layout_width="0dp"
android:layout_height="200dp"
android:layout_marginStart="5dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="5dp"
android:layout_marginBottom="200dp"
android:background="#504C4C"
TextView tv = findViewById(R.id.test_text);
tv.setMovementMethod(new ScrollingMovementMethod());