Skip to content

Instantly share code, notes, and snippets.

View tobischw's full-sized avatar

Tobi Schweiger tobischw

  • Square Inc.
  • 00:24 (UTC -05:00)
View GitHub Profile
@jstanden
jstanden / gist:1489447
Last active May 15, 2024 20:47
Simplex Noise in C# for Unity3D - Adapted from James Livingston's MinePackage: http://forum.unity3d.com/threads/minepackage-minecraft-starter-package.69573/
using UnityEngine;
using System.Collections;
public class SimplexNoiseGenerator {
private int[] A = new int[3];
private float s, u, v, w;
private int i, j, k;
private float onethird = 0.333333333f;
private float onesixth = 0.166666667f;
private int[] T;
@QuantumCD
QuantumCD / Qt 5 Dark Fusion Palette
Created August 15, 2013 21:40
This is a complete (I think) dark color palette for the Qt 5 Fusion theme, as well as a nice style sheet for the tool tips that make them blend better with the rest of the theme. To have immediate effect, be sure to put this in your main function before showing the parent window. Child windows should automatically inherit the palette unless you …
qApp->setStyle(QStyleFactory::create("Fusion"));
QPalette darkPalette;
darkPalette.setColor(QPalette::Window, QColor(53,53,53));
darkPalette.setColor(QPalette::WindowText, Qt::white);
darkPalette.setColor(QPalette::Base, QColor(25,25,25));
darkPalette.setColor(QPalette::AlternateBase, QColor(53,53,53));
darkPalette.setColor(QPalette::ToolTipBase, Qt::white);
darkPalette.setColor(QPalette::ToolTipText, Qt::white);
darkPalette.setColor(QPalette::Text, Qt::white);
@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active July 6, 2024 20:09
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\

@digitalshadow
digitalshadow / OpenSimplexNoise.cs
Last active June 25, 2024 07:41
OpenSimplex Noise Refactored for C#
/* OpenSimplex Noise in C#
* Ported from https://gist.github.com/KdotJPG/b1270127455a94ac5d19
* and heavily refactored to improve performance. */
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
namespace NoiseTest
@raym
raym / synchsafe.js
Last active February 27, 2024 07:40
synchsafe conversion functions
/*
Synchsafe integers are used in ID3 tags
http://id3.org/id3v2.4.0-structure (6.2)
https://en.wikipedia.org/wiki/Synchsafe
The why of synchsafe:
http://stackoverflow.com/a/5652842
Example:
255 (%11111111) encoded as a 16 bit synchsafe integer is 383 (%00000001 01111111).
hader "Unlit/GridOverlay"
{
Properties
{
_GridSize("Grid Size", Float) = 10
_Grid2Size("Grid 2 Size", Float) = 160
_Grid3Size("Grid 3 Size", Float) = 320
_Alpha ("Alpha", Range(0,1)) = 1
}
SubShader
@acamino
acamino / HttpClientApproach.cs
Last active May 25, 2024 20:52
4 Ways to Parse a JSON API with C#
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
namespace HttpClientApproach
{
internal class Contributor
{
public string Login { get; set; }
@simonkim
simonkim / rtp-sync-ntp.md
Last active January 25, 2024 16:40
RTP - Synchronizing media streams

RTP Note

Synchronizing media streams

Implementation of NTP is not required to use RTP.

An implementation is not required to run the Network Time Protocol in order to use RTP. -- 4. Byte Order, Alignment, and Time Format, [RFC 3550 RTP: A Transport Protocol for Real-Time Applications][1]

However, if NTP timestamp implemented in RTCP, it can be used to synchronize media streams even from different host!

@topriddy
topriddy / README.md
Created September 10, 2016 11:44
Steps for Integrating Jacoco in IntelliJ IDEA
  1. Integrate the dependency and plugin sections to relevant parts in your pom.xml from the pom.xml_fragment file below.
  2. Run "mvn clean package" to generate the results
  3. In IntelliJ, Select "Analyse -> Show Coverage Data..." and pick your Jacoco output file. This should be the path specified in the plug-in config i.e: ${basedir}/target/coverage-reports/jacoco-unit.exec

Output should be displayed in the IDE and you should also have the classes overlayed with test coverage.

@jschomay
jschomay / NestedList.elm
Created March 21, 2017 03:38
Nested List example in Elm
import Html exposing (text)
import List
{- Challenge: flatten an array of arbitrarily nested arrays of integers into a flat array of integers. e.g. [[1,2,[3]],4] -> [1,2,3,4].
(This is a little tricky in Elm because the type system does not allow for lists with different element types. So we have to make a whole new data structure...)
-}