Skip to content

Instantly share code, notes, and snippets.

View magmastonealex's full-sized avatar

Alex Roth magmastonealex

View GitHub Profile
@magmastonealex
magmastonealex / j2v8.md
Last active July 15, 2022 14:53
Building J2V8 for Android

You must do this on a Linux system. Mac V8 builds (at least for Android) are broken, and the build processs generates thin archives with absolute paths. So, until the J2V8 compile is done and has produced an AAR, you'll need to stay on the same machine. The AAR, however, is portable everywhere.

These directions are the result of a lot of trial-and-error, and were written for an Arch system, but there's no reason it wouldn't work on any distro.

Note that you must be careful to reconstruct your environment if you exit your shell session!

Building V8:

  • mkdir v8-builder
diff --git a/qtdeclarative-opensource-src-5.9.3/qtdeclarative.pro b/qtdeclarative-opensource-src-5.9.3-patched/qtdeclarative.pro
index 5b94da9..b1bb628 100644
--- a/qtdeclarative.pro
+++ b/qtdeclarative.pro
@@ -1,4 +1,4 @@
-CONFIG += tests_need_tools examples_need_tools
+CONFIG += tests_need_tools examples_need_tools debug
load(qt_parts)
!python_available {
@magmastonealex
magmastonealex / keybase.md
Created August 24, 2016 23:43
Keybase proof

Keybase proof

I hereby claim:

  • I am magmastonealex on github.
  • I am magmastonealex (https://keybase.io/magmastonealex) on keybase.
  • I have a public key ASDoz56F8NS5zgJvh2CwNrF6lWlhNa2uyJ-mWzsYp_-zSwo

To claim this, I am signing this object:

@magmastonealex
magmastonealex / parse.py
Last active August 10, 2016 15:46
A small program to generate Android layout initializers from XML.
import lxml.etree as ET
import sys
defs=[]
binds=[]
for event, element in ET.iterparse(open(sys.argv[1])):
try:
elid = element.attrib["{http://schemas.android.com/apk/res/android}id"]
elid = elid.split("/")[-1]
elid_transform = elid.split(".")[-1]
from openid.store import filestore
from openid.consumer import consumer
from lib.persistDict import getDict
from lib.login import *
import sha
import web
class openid_fin:
def GET(self):
dicti = {}
from openid.store import filestore
from openid.consumer import consumer
from lib.persistDict import saveDict
import web
class openid_begin:
def GET(self):
s = {}
#web.config.db_parameters = {'dbn' : 'sqlite','db' : 'web.db'}
oidconsumer = consumer.Consumer(s, filestore.FileOpenIDStore("nonce"))
<?php
$in = file_get_contents("DATA2.txt");
$data = explode("\n", $in);
foreach ($data as $instring){
$finaldata = explode(" ", $instring);
$given = intval($finaldata[0]);
Declare string to check
String with All of the vowels
String with All of the consonants
Make variable to count vowels
Make variable to count consonants
For length of string
Set achar to the current character of the strings
For length of vowels
If the current vowel equals the current character
<?php
$arr = array(3,6,7,9,10,6,7,2,1);
$count = 0;
foreach ($arr as $value) {
if($value >= 5){
$count++;
}
}
echo $count;
?>
<?php
$t1 = 120;
$t2 = 71;
$count = 2;
while($t2 < $t1){
$temp = $t2;
$t2 = $t1-$t2;
$t1 = $temp;