Skip to content

Instantly share code, notes, and snippets.

using System;
using System.Linq;
namespace CSharp
{
class FindFrog
{
static void Main(string[] args)
{
long now = DateTimeOffset.Now.ToUnixTimeSeconds();
@yoavst
yoavst / TitaniumResourcesExtractor.kt
Created September 9, 2017 12:21
Titanium app resources extractor
package com.yoavst.psychometric
import org.apache.commons.lang3.StringEscapeUtils
import java.io.File
import java.nio.CharBuffer
import javax.crypto.spec.SecretKeySpec
import javax.crypto.Cipher
/**
* Based on https://www.npmjs.com/package/ti_recover
@yoavst
yoavst / psychometricExamParser.kt
Created April 5, 2017 09:05
Parse psychometric exam pdf file
package com.yoavst.psychometric
import com.yoavst.resourceOf
import org.apache.pdfbox.pdmodel.PDDocument
import org.apache.pdfbox.text.PDFTextStripper
import org.apache.pdfbox.text.TextPosition
fun main(args: Array<String>) {
val file = File("psychometric/exam.pdf")
val document = PDDocument.load(file)
@yoavst
yoavst / Clicker.kt
Created February 28, 2017 15:52
Clicker for Fifty
package com.yoavst.testing
import android.content.Intent
import android.support.test.InstrumentationRegistry
import android.support.test.filters.SdkSuppress
import android.support.test.runner.AndroidJUnit4
import android.support.test.uiautomator.*
import com.github.salomonbrys.kotson.*
import com.google.gson.JsonParser
import fr.arnaudguyon.xmltojsonlib.XmlToJson
@yoavst
yoavst / game.kt
Last active March 3, 2017 12:00
Game of Life
package com.yoavst.testing
fun main(args: Array<String>) {
/*
* Read cells.
* Format: y,x
* Where y,x are zero based.
* Stops when receive input "stop".
*/
val input = generateSequence { readLine()?.takeIf { it != "stop" }?.split(',')?.let { (y, x) -> x.toInt() to y.toInt() } }
@yoavst
yoavst / BMPHider.java
Created September 19, 2016 11:51
BMPHider
package com.yoavst.hacking;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.List;
@yoavst
yoavst / log.py
Last active March 27, 2016 16:14
Skillz Logging "Framework"
LEVEL_VERBOSE = 1
LEVEL_INFO = 2
LEVEL_DEBUG = 3
LEVEL_ERROR = 4
TITLES = {LEVEL_VERBOSE: "V", LEVEL_INFO: "I", LEVEL_DEBUG: "D", LEVEL_ERROR: "E"}
DEFAULT_TAGS = ["Manager", "gameinfo"]
class Logger(object):
@yoavst
yoavst / Output
Created September 11, 2015 10:32
OptiBus problem solver
|6:30|6:45|7:00|7:15|7:30|7:45|8:00|8:15|8:30|8:45|9:00|9:15|9:30|9:45|10:00|
01| 12 | 12 | 12 | 12 | 7 | 7 | 7 | 7 | 6 | 6 | 6 | 6 | | | |
02| 15 | 15 | 15 | 15 | | 10 | 10 | 10 | 10 | | 9 | 9 | 9 | 9 | |
03| | | 1 | 1 | 1 | 1 | 16 | 16 | 16 | 16 | 5 | 5 | 5 | 5 | |
04| | | 4 | 4 | 4 | 4 | 8 | 8 | 8 | 8 | | | | | |
05| | | | 11 | 11 | 11 | 11 | 13 | 13 | 13 | 13 | | | | |
06| | | | 14 | 14 | 14 | 14 | | | | | | | | |
07| | | | | 2 | 2 | 2 | 2 | 17 | 17 | 17 | 17 | | | |
08| | | | | 3 | 3 | 3 | 3 |free| | 18 | 18 | 18 | 18 | |
@yoavst
yoavst / CodeguruSurvivorGenerator.kt
Last active April 2, 2017 18:06
Create survivor for codeguru from image
package com.yoavst.bgonen
import java.io.File
import javax.imageio.ImageIO
fun main(args: Array<String>) {
val image = ImageIO.read(File("""IMAGE_PATH"""))
val w = image.width
val h = image.height
val array = Array(w) { IntArray(h) }