Skip to content

Instantly share code, notes, and snippets.

View ademar111190's full-sized avatar
Lightning Networking the Bitcoin

Ademar ademar111190

Lightning Networking the Bitcoin
  • CEO of Bitcoin
  • Itatiba
View GitHub Profile
@alwynpan
alwynpan / 11-seven.md
Last active May 23, 2023 11:12
Mock location on LineageOS 16/17 with GPS Joystick

Mock location on LineageOS 16/17 with GPS Joystick

Prerequisite

  • A computer (tested on Windows 10, but I don't see any reason it won't work with macOS or Linux).

  • A LineageOS 16/17 compatible phone (LineageOS 16 is recommended, some users reported random crash on LineageOS 17).

  • Download the minimal ADB from XDA Developers Forum and unzip it.

@gacordeiro
gacordeiro / Ternary in Kotlin
Last active March 13, 2020 17:17
Ternary in Kotlin
class _Ternary<out T>(val condition: Boolean, val ifTrue: T)
infix fun <T> Boolean.then(ifTrue: T): _Ternary<T> = _Ternary(this, ifTrue)
infix fun <T> _Ternary<T>.otherwise(ifFalse: T): T = if (condition) ifTrue else ifFalse
const val tellMeTheTruth: Boolean = true
val result: String = tellMeTheTruth then "I'll believe you" otherwise "I'll never trust you"
#!/bin/bash
order=("screenName" "eventCategory" "eventAction" "eventLabel")
printf '%s;' ${order[@]} > $1.csv
echo >> $1.csv
while IFS='' read -r line || [[ -n "$line" ]]; do
if ! [[ "$line" == *"Passing"* ]]; then continue; fi
IFS=',' read -r -a split <<< "$line"
@avafloww
avafloww / PhpJava.java
Last active October 16, 2022 18:50
This snippet of code is syntactically valid in both PHP and Java, and produces the same output in both.
/*<?php
//*/public class PhpJava { public static void main(String[] args) { System.out.printf("/*%s",
//\u000A\u002F\u002A
class PhpJava {
static function main() {
echo(//\u000A\u002A\u002F
"Hello World!");
}}
//\u000A\u002F\u002A
PhpJava::main();
@lisawray
lisawray / MainActivity.java
Last active March 26, 2023 11:57
Vector drawables from XML with the Android support library 23.3.0
package com.xwray.vectorbinding;
import android.databinding.BindingAdapter;
import android.databinding.DataBindingUtil;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.support.graphics.drawable.VectorDrawableCompat;
import android.support.v7.app.AppCompatActivity;
import android.widget.TextView;
@bkase
bkase / apps_com.example.appname_BUCK
Last active February 24, 2020 02:00
Kotlin Buck build files
android_binary(
name = 'app',
manifest = 'AndroidManifest.xml',
keystore = ':debug_keystore',
use_split_dex = True,
primary_dex_patterns = [
'^com/tryroll/roll/AppShell^',
'^com/tryroll/roll/debug/AppShell^',
'^com/tryroll/roll/BuildConfig^',
@leite
leite / ftee.c
Created April 7, 2015 09:20
ftee, behaves similarly to tee but clones the stdin to stdout and to a named pipe without blocking
/* ftee - clone stdin to stdout and to a named pipe
(c) racic@stackoverflow
WTFPL Licence */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
remove mod4 = Super_L
add control = Super_L
remove control = Control_L
add mod4 = Control_L
@bikz05
bikz05 / cie2000.py
Last active April 22, 2020 11:37
Color Difference using CIE DE2000
### colormath is needed to run the script
### Ubuntu users can get it by typing the 2 command below -
### `sudo apt-get install python-pip`
### `sudo pip install colormath`
from colormath.color_objects import sRGBColor, LabColor
from colormath.color_conversions import convert_color
from colormath.color_diff import delta_e_cie2000
# Red Color
@ademar111190
ademar111190 / alah
Created October 22, 2014 16:32
Show one of ninety nine allah`s names
#!/usr/local/bin/lua
Alah = {}
Alah.__index = Alah
function Alah:new(latin, arabic, portuguese)
o = {}
setmetatable(o, self)
self.__index = self
self.latin = latin