This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Call swig: "swig -java -c++ -package org.chatsecure.olmwrapper -outdir ~/Code/olmJava olm.i" | |
*/ | |
%module olmwrapper | |
%{ | |
/* Put headers and other declarations to include in the wrapper code here */ | |
#include "olm.hh" | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* ---------------------------------------------------------------------------- | |
* This file was automatically generated by SWIG (http://www.swig.org). | |
* Version 3.0.8 | |
* | |
* Do not make changes to this file unless you know what you are doing--modify | |
* the SWIG interface file instead. | |
* ----------------------------------------------------------------------------- */ | |
public class Account { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static final String FRAGMENT_SHADER_MIRROR = | |
"#extension GL_OES_EGL_image_external : require\n" + | |
"precision mediump float;\n" + | |
"varying vec2 vTextureCoord;\n" + // Coordinate within texture | |
"uniform samplerExternalOES sTexture;\n" + // Texture | |
"uniform vec2 uPosition;\n" + // Position within OpenGL scene | |
"void main() {\n" + | |
" vec2 texCoord = vTextureCoord.xy;\n" + | |
" vec2 normCoord = 2.0 * texCoord - 1.0;\n"+ | |
" normCoord.x = normCoord.x * sign(normCoord.x + uPosition.x);\n"+ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ./configure --prefix=/usr/local/ --with-boost=/usr/local --with-libevent=/usr/local | |
... | |
$ make | |
... | |
/bin/sh ../../../libtool --tag=CXX --mode=link g++ -Wall -Wextra -pedantic -g -O2 -std=c++11 -L/usr/local/lib -o processor_test processor/ProcessorTest.o processor/EventLog.o processor/ServerThread.o libprocessortest.la ../../../lib/cpp/libthrift.la ../../../lib/cpp/libthriftnb.la -L/usr/local/lib -levent -l:libboost_unit_test_framework.a -lssl -lcrypto -lpthread | |
libtool: link: g++ -Wall -Wextra -pedantic -g -O2 -std=c++11 -o .libs/processor_test processor/ProcessorTest.o processor/EventLog.o processor/ServerThread.o -Wl,-bind_at_load -L/usr/local/lib ./.libs/libprocessortest.a ../../../lib/cpp/.libs/libthrift.dylib ../../../lib/cpp/.libs/libthriftnb.dylib -levent -l:libboost_unit_test_framework.a -lssl -lcrypto -lpthread | |
ld: library not found for -l:libboost_unit_test_framework.a | |
clang: error: linker command failed with exit code 1 (use -v to see invocation) | |
make[4]: *** [processor_test] Error 1 | |
make[3] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Modified Pi-hole script to generate a generic hosts file | |
# for use with dnsmasq's addn-hosts configuration | |
# original : https://github.com/jacobsalmela/pi-hole/blob/master/gravity-adv.sh | |
# The Pi-hole now blocks over 120,000 ad domains | |
# Address to send ads to (the RPi) | |
piholeIP="192.168.1.1" | |
outlist='./final_blocklist.txt' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import subprocess | |
DEX2JAR_PATH = ‘/PATH/TO/dex2jar-2.0/d2j-dex2jar.sh' # https://github.com/pxb1988/dex2jar | |
APKTOOL_JAR_PATH = ‘PATH/TO/apktool.jar' # http://ibotpeaches.github.io/Apktool/install/ | |
JDCLI_JAR_PATH = '/PATH/TO/jd-cli.jar' # https://github.com/kwart/jd-cmd | |
# TODO SANITIZE INPUT | |
query = sys.argv[1] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import boto.iam | |
''' | |
Delete the NUM_USERS_TO_DELETE oldest IAM users in your account* | |
*IMPORTANT: The boto iam api appears to only allow querying 1000 users | |
at a time so if you have over 1000 IAM users there is no guarantee these | |
will be the oldest. The deleted users are only guaranteed to be the oldest | |
among the 1000 aws returns us. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Construct a single image by stacking the bottom READ_HORIZ_PX | |
of each source frame of form image-XXXX.jpeg. | |
To create source frames of form image-XXXX.jpeg from a video file: | |
$ ffmpeg -i inputfile.avi image-%4d.jpeg | |
This was helpful in extracting a QR code partially displayed | |
across many frames. | |
''' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (/* your media path came from Android Storage Access Framework on 4.4+ */) { | |
//mediaFile.getPath() = "content://com.android.providers.media.documents/document/video:183" | |
long videoId = Long.parseLong(Uri.parse(mediaFile.getPath()).getLastPathSegment().split(":")[1]); | |
Bitmap thumbnail = MediaStore.Video.Thumbnails.getThumbnail(mContext.getContentResolver(), | |
videoId, | |
MediaStore.Images.Thumbnails.MINI_KIND, // 512 x 384 | |
//MediaStore.Images.Thumbnails.MICRO_KIND, // 96 x 96 | |
null)); // BitmapFactory.Options |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
getCurrentCamera().setPosition(0, 0, 0); | |
Sphere sphere = new Sphere(10, 24, 24); | |
/** Below renders a portion of the exterior of the sphere with texture applied */ | |
sphere.setPosition(0, 0, -13); | |
/** Below renders nothing when I'd expect to "see" the interior of the sphere */ | |
//sphere.setPosition(0, 0, 0); | |
Material material = new Material(); | |
material.addTexture(new Texture("brc", R.drawable.brc_sm)); | |
sphere.setMaterial(material); |
NewerOlder