Skip to content

Instantly share code, notes, and snippets.

View falconepl's full-sized avatar

Przemysław Sokół falconepl

View GitHub Profile
@densh
densh / Snake.scala
Last active December 19, 2021 05:05
Snake game in 200 lines of Scala Native and SDL2 as demoed during Scala Matsuri 2017
import scalanative.native._
import SDL._
import SDLExtra._
@extern
@link("SDL2")
object SDL {
type Window = CStruct0
type Renderer = CStruct0
@nstarke
nstarke / release-android-debuggable.md
Last active April 16, 2024 08:06
How to make a Release Android App debuggable

How to make a Release Android App debuggable

Let's say you want to access the application shared preferences in /data/data/com.mypackage.
You could try to run adb shell and then run-as com.mypackage ( or adb shell run-as com.mypackge ls /data/data/com.mypackage/shared_prefs), but on a production release app downloaded from an app store you're most likely to see:

run-as: Package 'com.mypackage' is not debuggable
@carymrobbins
carymrobbins / pretty-print.scala
Last active January 17, 2024 14:02
Pretty print Scala case classes and other data structures.
/**
* Pretty prints a Scala value similar to its source represention.
* Particularly useful for case classes.
* @param a - The value to pretty print.
* @param indentSize - Number of spaces for each indent.
* @param maxElementWidth - Largest element size before wrapping.
* @param depth - Initial depth to pretty print indents.
* @return
*/
private def prettyPrint(a: Any, indentSize: Int = 2, maxElementWidth: Int = 30, depth: Int = 0): String = {
@ktoso
ktoso / structural_types_slow.scala
Last active August 29, 2015 14:16
structural types are slow :-)
package com.typesafe.benchmarks
import java.util.concurrent.TimeUnit
import org.openjdk.jmh.annotations._
@State(Scope.Benchmark)
@BenchmarkMode(Array(Mode.AverageTime))
@OutputTimeUnit(TimeUnit.NANOSECONDS)
class ReflectBenchmark {
@bennadel
bennadel / watch-functions.htm
Created July 11, 2014 12:29
Using Scope.$watch() To Watch Functions In AngularJS
<!doctype html>
<html ng-app="Demo">
<head>
<meta charset="utf-8" />
<title>
Using Scope.$watch() To Watch Functions In AngularJS
</title>
<link rel="stylesheet" type="text/css" href="./demo.css"></link>
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active April 22, 2024 01:47
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@mackuba
mackuba / coworking.md
Last active March 21, 2023 08:21
Lista coworkingów w Krakowie

Coworking w Krakowie

Update 28.04.2018

Otworzyło się ostatnio tyle nowych coworków, że nie nadążam tego odwiedzać :) Będę się starał stopniowo aktualizować listę, w międzyczasie polecam przeglądnąć komentarze pod postem. (Nie chcę szczerze mówiąc przenosić tego do jakiegoś bardziej zorganizowanego repozytorium, bo chcę, żeby to pozostało takim moim osobistym nieobiektywnym review tych coworków - ciężko byłoby uzgadniać, czy w danym miejscu jest głośno, albo czy jest fajna atmosfera... W razie wątpliwości, post jest dostępny na licencji WTFPL :)

Przydatne linki:

@cb1kenobi
cb1kenobi / github_widescreen
Last active November 6, 2019 05:07
Greasemonkey script to make GitHub widescreen friendly. There's probably some quirks. Use at your own risk.
// ==UserScript==
// @name GitHub Widescreen
// @namespace https://github.com
// @include https://github.com/*
// @grant none
// ==/UserScript==
(function() {
var style = document.createElement("style");
style.type = "text/css";
style.innerHTML = "\
@evandrix
evandrix / README.md
Created September 11, 2012 00:06
Headless web browsers

Here are a list of headless browsers that I know about:

  • [HtmlUnit][1] - Java. Custom browser engine. JavaScript support/DOM emulated. Open source.
  • [Ghost][2] - Python only. WebKit-based. Full JavaScript support. Open source.
  • [Twill][3] - Python/command line. Custom browser engine. No JavaScript. Open source.
  • [PhantomJS][4] - Command line/all platforms. WebKit-based. Full JavaScript support. Open source.
  • [Awesomium][5] - C++/.Net/all platforms. Chromium-based. Full JavaScript support. Commercial/free.
  • [SimpleBrowser][6] - .Net 4/C#. Custom browser engine. No JavaScript support. Open source.
  • [ZombieJS][7] - Node.js. Custom browser engine. JavaScript support/emulated DOM. Open source.
  • [EnvJS][8] - JavaScript via Java/Rhino. Custom browser engine. JavaScript support/emulated DOM. Open source.
@earthgecko
earthgecko / bash.generate.random.alphanumeric.string.sh
Last active April 2, 2024 15:59
shell/bash generate random alphanumeric string
#!/bin/bash
# bash generate random alphanumeric string
#
# bash generate random 32 character alphanumeric string (upper and lowercase) and
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
# bash generate random 32 character alphanumeric string (lowercase only)
cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 32 | head -n 1