Skip to content

Instantly share code, notes, and snippets.

// FRAGMENT SHADER
precision mediump float;
uniform vec2 u_position;
uniform vec3 u_palette[256];
void main() {
int index = 5;
vec3 palColor = u_palette[index];
// VERTEX SHADER
attribute vec2 a_position;
uniform vec2 u_resolution;
uniform vec3 u_palette[256];
varying vec3 v_color;
void main() {
var leftleggeo = new THREE.CubeGeometry(4, 12, 4);
var leftleg = new THREE.Mesh(leftleggeo, new THREE.MeshFaceMaterial());
leftleg.position.z = -2;
leftleg.position.y = -6;
scene.add(leftleg);
@daniel-j
daniel-j / gist:3829127
Created October 3, 2012 19:14
Yatzy by djazz
#include <iostream>
#include <string>
#include <ctime>
#include <cstdlib>
#include <fstream>
using namespace std;
const int DICE_COUNT = 5;
const int ROUND_COUNT = 6;
@daniel-j
daniel-j / gist:3841983
Created October 5, 2012 19:53
Node.js LAN port scanner
var net = require('net');
var dns = require('dns');
var startAddress = "194.47.158.";
var scanAddress = "194.47.158.252";
var scanPort = 5357;
scanByPort(startAddress, scanPort, function (scanlist) {
console.log(startAddress+"*: [ "+scanlist.join(", ")+" ]");
@daniel-j
daniel-j / gist:4711506
Created February 5, 2013 02:02
SGIP BOT
'use strict';
var net = require('net');
var dgram = require('dgram');
var sqlite3 = require('sqlite3').verbose();
function openDb () {
var db = new sqlite3.Database('bot.sqlite', function (err) {
if (err) {
console.log("Error opening database", err);
}
@daniel-j
daniel-j / gist:4718705
Created February 5, 2013 23:29
Heap.h
#ifndef HEAP_H
#define HEAP_H
#include <iostream>
using namespace std;
template <typename T>
class Heap {
private:
@daniel-j
daniel-j / spotify.js
Last active January 6, 2024 04:19
A simple node.js program to listen to Spotify tracks, albums and playlists
#!/usr/bin/env node
'use strict';
/*
This is a simple Spotify cli-based client with optional Icecast2/shout support!
It should work for non-premium users, but you must connect your Spotify account to Facebook.
Usage:
$ node spotify <spotify uris> <playlist uri> <album uri> <track uri> <etc...>
@daniel-j
daniel-j / automatic.js
Last active December 22, 2015 23:39
dbwebb grill ht13 solver
#!/usr/bin/env node
// By djazz
// http://djazz.mine.nu
var net = require('net');
var cmd = new Buffer(new Buffer("げ啖䕉卒ㅔ兂噒獉啒儱䙖杫䙒偊䙕䙂楕䡸噒村こ婖䙌呖卒䱂噒杫ご朴け偸さ啖䕌䙤䍖佂啑䈱噕䉖䙌呖卒佂啑䈱噕䉖䕉伹䕉圹啒猴噖䙎䕉䈵啔剆啖杅ご朴歑倹䕖獧ㅔ䙂楔呂啑䙚䕌䙤䍖兂噑䙂汕獍啓吵噒啊䕉佬䕖朸歑倹祓兂噑䙂汕獍げ啖䙉䉒歑䙸䕌卒ㅔ杁啑䵸䙉䉒歑䙸祕䙸䕗啬䙉䙰歕㴸" , "ucs2").toString(), "base64").toString().split(",");
var client = net.connect(2323, "dbwebb.se", function () {

Grund:

  • Inte Ubuntu Unity eller GNOME Shell
  • Linux Mint XFCE
  • Manjaro (XFCE)
  • Xubuntu (XFCE)
  • Lubuntu (LXDE)
  • Debian

Skrivbordsmiljöer (väljs vid login)