Skip to content

Instantly share code, notes, and snippets.

Avatar
🍄
PowerUp!

axet

🍄
PowerUp!
View GitHub Profile
@axet
axet / build.sh
Last active Jan 16, 2019
golang armv5 build
View build.sh
#!/bin/bash
set -e
export GOCACHE=off
export NDK=~/Library/Android/sdk/ndk-r16b/
export TOOLCHAIN=$PWD/tools/
[ -e $TOOLCHAIN ] || $NDK/build/tools/make_standalone_toolchain.py --arch arm --api 14 --install-dir $TOOLCHAIN
View Simple.c
/* Simple.c
This is a Win32 C application (ie, no MFC, WTL, nor even any C++ -- just plain C) that demonstrates
how to embed a browser "control" (actually, an OLE object) in your own window (in order to display a
web page, or an HTML file on disk).
This example opens two windows, each containing a browser object. The first window displays an HTML
string in memory. The second window displays Microsoft's web site. We also disable the pop-up context
menu, and resize the browser to fill our window.
View CameraToMpegTest.java
/*
* Copyright 2013 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@axet
axet / bash_args.sh
Last active Mar 8, 2016
Keep unparsed bash arguments as array
View bash_args.sh
# keep unparsed parameters in the ARGS array
ARGS=()
# keep unparsed strings/filenames as separate array
FILES=()
while [[ $# > 0 ]]; do
key="$1"
case $key in
-a|--avd)
AVD=YES
@axet
axet / jpg.py
Last active Mar 5, 2016
read jpg props (width, height, density, bpc) with python no additional libs
View jpg.py
# https://www.opennet.ru/docs/formats/jpeg.txt
#
# - $ff, $c0 (SOF0)
# - length (high byte, low byte), 8+components*3
# - data precision (1 byte) in bits/sample, usually 8 (12 and 16 not
# supported by most software)
# - image height (2 bytes, Hi-Lo), must be >0 if DNL not supported
# - image width (2 bytes, Hi-Lo), must be >0 if DNL not supported
# - number of components (1 byte), usually 1 = grey scaled, 3 = color YCbCr
# or YIQ, 4 = color CMYK)
View expand.js
javascript:
$("a").each(function() {
if ($(this).attr("target") != "ANIMATION") return;
var href = $(this).attr("href");
if (href.startsWith("../refs")) {
$(this).load(href, function() {
$(this).wrap("<small></small>");
$(this).parent().text(" [" + $(this).text() + "] ");
@axet
axet / simpledb.go
Created Nov 22, 2015
simple on memory db
View simpledb.go
package main
import (
"bufio"
"errors"
"fmt"
"os"
"strings"
)
View ejabberd-1.1.2-saslauthd.diff
diff -r -u -N aclocal.m4 aclocal.m4
--- aclocal.m4 2006-09-28 00:49:59.000000000 +0400
+++ aclocal.m4 2007-02-03 18:50:05.000000000 +0300
@@ -292,3 +292,44 @@
fi
])
dnl <openssl/>
+
+dnl bsd_sockets.m4--which socket libraries do we need?
+dnl Derrick Brashear
View FragmentManagerHelper.java
import java.util.HashMap;
import java.util.Set;
import java.util.TreeSet;
import android.app.Fragment;
import android.app.FragmentManager;
import android.app.FragmentManager.BackStackEntry;
/**
* problem with replacing f2 with f3 and not removing f3 when rollingback f2
View 15puzzle-boost.cpp
#include <boost/graph/astar_search.hpp>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/random.hpp>
#include <boost/random.hpp>
#include <boost/graph/graphviz.hpp>
#include <boost/multi_index_container.hpp>
#include <boost/multi_index/identity.hpp>
#include <boost/multi_index/ordered_index.hpp>
#include <boost/multi_index/member.hpp>
#include <boost/multi_index/sequenced_index.hpp>