Skip to content

Instantly share code, notes, and snippets.

View kottkrig's full-sized avatar

Johan Larsson kottkrig

View GitHub Profile
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
@kottkrig
kottkrig / airsonos.md
Last active May 1, 2019 20:13
Installera Airsonos

En guide för att installera Airsonos på en Raspberry Pi 2 helt headless. Du behöver inte koppla in skärm, mus eller tangentbord till din Raspberry Pi.

  1. Installera Raspbian Jessie på ett SD-kort.
  2. Koppla upp raspberry pi till nätverket och ström.
  3. Hitta ip-adressen till raspberry pi: arp -a | grep b8:27:eb | grep -Eo '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' (Copy-paste på detta till terminalen)
  4. ssh pi@ip-adress-från-steg-3 (Default lösenord är ´raspberry`)
  5. Expandera partion till hela minneskortet sudo raspi-config. Kör Expand Filesystem.
  6. Välj att starta om när du väljer Finish i raspi-config.
  7. SSH:a in på Raspberry Pi:n igen: ssh pi@ip-adress-från-steg-3.
  8. sudo apt-get update

Ordlista

// Variable (Variabel)
var aCoolVariable = 10;
var anotherCoolVariable = ”Hej!;

// Function (Funktion)
function aCoolFunction(aVariable) {

tEst

Test 2!

#define LOWERLIGHT 150
#define UPPERLIGHT 600
#define NEAR 50 //cm
string light;
string distance;
string touch;
int US;
int TOUCH;
@kottkrig
kottkrig / gist:816224
Created February 8, 2011 10:15
Problems with fogfilter
var fogMaterial:ColorMaterial = new ColorMaterial(0xBCC687);
var fog:FogFilter = new FogFilter({ minZ:100,
maxZ:600,
subdivisions:20,
material:fogMaterial } );
var filters:Array = [fog];
var renderer:BasicRenderer = new BasicRenderer();
renderer.filters = filters;
/**
* @author conmind
*/
public class HMACSHA1 {
public static byte[] getHmacSHA1( String data,String key){
byte[] ipadArray = new byte[64];
byte[] opadArray = new byte[64];
byte[] keyArray = new byte[64];
int ex = key.length();
SHA1 sha1= new SHA1();
public class SHA1 {
private final int[] abcde = {
0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0
};
// Summary data storage array
private int[] digestInt = new int[5];
// The calculation process for temporary data storage array
private int[] tmpData = new int[80];