Skip to content

Instantly share code, notes, and snippets.

View DerGoogler's full-sized avatar
🍃
Busy.

Der_Googler DerGoogler

🍃
Busy.
View GitHub Profile
@parse
parse / shell.c
Created May 11, 2011 07:31
Simple shell in C
/* Compile with: g++ -Wall –Werror -o shell shell.c */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
@erberg
erberg / HTML - Starter Template
Created May 21, 2013 19:09
HTML Starter Template
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
<!-- Place favicon.ico and apple-touch-icon.png in the root directory -->
@rxaviers
rxaviers / gist:7360908
Last active July 27, 2024 17:59
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@lifuzu
lifuzu / helloworld.dex.md
Created April 1, 2014 17:10
execute the dex file in android with command
public class HelloWorld {
    public static void main(String[] args) {
         System.out.println("Hello World!");
    }
}

To run it on an android device:

javac HelloWorld.java
@thinzaroo
thinzaroo / copyAssetsToSDCard.java
Created June 17, 2014 07:50
Copy files from Android's assets folder to external storage (We will put some defaults files in /Assets folder, copy to /data/data/PACKAGE_NAME/images folder at runtime. And later, if new files available, the app will download images and replace to data/data folder)
private void copyAssets() {
AssetManager assetManager = getAssets();
String[] files = null;
try {
files = assetManager.list("img");
} catch (IOException e) {
Log.e("tag", "Failed to get asset file list.", e);
}
for(String filename : files) {
@bendenoz
bendenoz / Beep.java
Last active July 24, 2024 13:35
Basic class to play system sound without user interaction from adb command line. Must be compiled to .dex file
import android.media.MediaPlayer;
import android.media.AudioManager;
import android.util.Log;
import java.io.IOException;
public class Beep {
/**
* Command-line entry point.
@jamesjara
jamesjara / webviewclient.java
Created March 30, 2015 05:54
Android inject js or css to external page webview
//---- Appened STYLE
//document.getElementsByTagName('html')[0].innerHTML+='<style>*{color:#fff}</style>'
StringBuilder extraStyles = new StringBuilder();
extraStyles.append("javascript:(function extra(){");
if(getResources().getBoolean(R.bool.extraCss)){
extraStyles.append(
"var aa =document.createElement(\"link\");" +
"aa.type='text/css'; aa.rel='stylesheet'; "+
"aa.href='"+getResources().getString(R.string.extraCssUrl)+"';"+
"document.getElementsByTagName(\"head\")[0].appendChild(aa);"
@gohilbhagirath90
gohilbhagirath90 / Set Property from android application
Created September 9, 2015 09:10
Set System Properties from android application
==> Add in AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
android:sharedUserId="android.uid.system"
xmlns:tools="http://schemas.android.com/tools"
package="com.example.example"
>
==> Android Source :
// For Properties permission
// Properties which start with "debug." have both SYSTEM & SHELL permisiion to edit
@bertrandmartel
bertrandmartel / build_curl.md
Last active October 10, 2023 17:14
Build Curl for Android NDK

Build libcurl for android NDK

Libcurl requires openssl and zlib to be fully operationnal

  • Step 1 : cross compile zlib
  • Step 2 : cross compile openssl
  • Step 3 : cross compile curl with zlib/openssl external link

Prerequisites :

@nabeix
nabeix / WebViewJSInterfaceMainActivity.java
Last active September 24, 2022 10:38
Check available types of Android WebView JavascriptInterface
package net.nabeix.javascriptinterfacetest;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.webkit.JavascriptInterface;
import android.webkit.WebView;
public class MainActivity extends AppCompatActivity {