Skip to content

Instantly share code, notes, and snippets.

@redanium
redanium / chat-frontend.js
Created August 10, 2016 22:40 — forked from martinsik/chat-frontend.js
Node.js chat frontend and server
$(function () {
"use strict";
// for better performance - to avoid searching in DOM
var content = $('#content');
var input = $('#input');
var status = $('#status');
// my color assigned by the server
var myColor = false;
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="8"/>
<uses-permission android:name="android.permission.READ_CONTACTS" />
<application android:label="@string/app_name">
@redanium
redanium / SomeFragment.java
Created April 21, 2016 22:27 — forked from joshdholtz/SomeFragment.java
Android Google Maps V2 - MapView in XML
public class SomeFragment extends Fragment {
MapView mapView;
GoogleMap map;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.some_layout, container, false);
@redanium
redanium / Atkinson dither in PHP
Created December 22, 2015 10:08 — forked from lordastley/Atkinson dither in PHP
1-bit Atkinson dither in PHP with GD
<?php
$img = imagecreatefromjpeg('./delayclose.jpg');
imagefilter($img, IMG_FILTER_GRAYSCALE);
$width = imagesx($img);
$height = imagesy($img);
$img_arr = array();
// Parse image (can be combined with dither stage, but combining them is slower.)
@redanium
redanium / wpa2-wifi-connect.sh
Created December 10, 2015 22:20 — forked from rjcorwin/wpa2-wifi-connect.sh
A simple `wifi` command for Debian that will connect you to a WPA2 WiFi network
#!/bin/sh
## A simple `wifi` command for Debian that will connect you to a WPA2 WiFi network
## usage:
## sudo ./wpa2-wifi-connect.sh <ssid> <pass>
ifdown wlan0
# build the interfaces file that will point to the file that holds our configuration
rm /etc/network/interfaces
touch /etc/network/interfaces

Reverse proxy over 3G modem (draft)

We will explain how to configure a cubieboard running debian as a reverese proxy. The modules that will be used are wvdial and autossh

Credits goes to:

1. http://blog.rootshell.be/2015/02/19/my-little-pwnie-box/
2. https://wiki.archlinux.org/index.php/3G_and_GPRS_modems_with_pppd
@redanium
redanium / readtag.c
Last active August 29, 2015 14:21 — forked from Jonty/readtag.c
#include <nfc/nfc.h>
#include <nfc/nfc-messages.h>
int main ()
{
nfc_device_t *nfcDev;
nfcDev = nfc_connect(NULL);
if (nfcDev == NULL) {
printf("Cannot connect to the RFID reader.\n");