Skip to content

Instantly share code, notes, and snippets.

View malkia's full-sized avatar

Dimiter 'malkia' Stanev malkia

View GitHub Profile
@etorreborre
etorreborre / gist:1387113
Created November 22, 2011 21:50
An example of a non-terminating compilation with javac
/** from http://www.reddit.com/r/programming/comments/mlbna/scala_feels_like_ejb_2/c31z0co */
interface Pong<T> {}
class Ping<T> implements Pong<Pong<? super Ping<Ping<T>>>> {
static void Ping() {
Pong<? super Ping<Long>> Ping = new Ping<Long>();
}
}
> javac Ping.java
@eahydra
eahydra / pe_checksum.c
Created September 19, 2012 05:03
pe file checksum
unsigned short ChkSum(unsigned int CheckSum, void *FileBase, int Length)
{
int *Data;
int sum;
if ( Length && FileBase != NULL)
{
Data = (int *)FileBase;
do
@jifalops
jifalops / _README.md
Last active June 30, 2019 18:53
Headless Crostini quick setup script for Flutter, VS Code, Node/npm (via nvm), Firebase tools, and pip for Python3

Headless Crostini quick setup script for Flutter, VS Code, Node/npm (via nvm), Firebase tools, and pip for Python3

Modify lines 20 and 21 with your gist and token for the VS Code settings-sync extension.

The script adds a symbolic link to the ChromeOS Downloads folder at ~/Downloads. For it to work, share your Downloads folder with Linux by right-clicking it in the Files app.

WARNING

  • The script appends to the PATH environment variable each time it runs (at the end).
  • settings.json for VS Code will be overwritten if it exists! (The default settings are empty and it was easier to do it this way than to use jq.)
@ajinasokan
ajinasokan / flutter_desktop_macos.md
Last active November 22, 2019 14:38
Run Flutter apps in MacOS with IDE support and hot reloading

This setup is only for MacOS. I don't have a windows/linux machine to test.

Clone FDE repo

cd ~
git clone https://github.com/google/flutter-desktop-embedding

Switch to flutter master

@remi
remi / .gitconfig
Created March 20, 2012 19:20
Find the most used verbs in your Git commit messages
[alias]
verbs = !git log --pretty=format:'%s' | cut -d \" \" -f 1 | sort | uniq -c | sort -nr
@binshengliu
binshengliu / install-clang-8-debian.sh
Created May 14, 2019 01:58
Install Clang-8 on Debian Stretch
sudo echo -e 'deb http://apt.llvm.org/stretch/ llvm-toolchain-stretch-8 main\ndeb-src http://apt.llvm.org/stretch/ llvm-toolchain-stretch-8 main\n' >> /etc/apt/sources.list
sudo aptitude install clang-8 clang-tools-8 clang-format-8
sudo aptitude install libc++-8-dev libclang-8-dev libc++abi-8-dev
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-8 100
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-8 100
sudo update-alternatives --install /usr/bin/clangd clangd /usr/bin/clangd-8 100
sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-8 100
@reinsteam
reinsteam / pcomp.md
Created November 20, 2016 12:04
Links to materials about perceptual image comparison metric

Perceptual Image Differencing

  • [1983. Peter Burt and Edward Adelson. The Laplacian Pyramid as a Compact Image Code][1]
  • [1993. Scott Daly. The visible differences predictor: an algorithm for the assessment of image fidelity][2]
  • [1995. Andrew S. Glassner. In Principles of digital image synthesis, pages 59-66][3]
  • [1997. Gregory Ward-Larson, Holly Rushmeier, and Christine Piatko. A visibility matching tone reproduction operator for high dynamic range scenes][4]
  • [1999. Mahesh Ramasubramanian, Sumant N. Pattnaik, Donald P. Greenberg. A perceptually based physical error metric for realistic image synthesis][5]
  • [2004. Yangli Hector Yee, Anna Newman. A perceptual metric for production Testing][6]
  • [2004. HECTOR YEE, SUMANTA PATTANAIK and DONALD P. GREENBERG. Spatiotemporal Sensitivity and Visual Attention for Efficient Rendering of Dynamic Environments][7]
  • [2004. Hector Yee. *A Perceptual Metric for Production Testing (Submitted and Accepted in Journal of
@mattbierner
mattbierner / life_comonadic.cpp
Created November 3, 2014 00:25
c++ Compile Time Comonaic Life
/**
* Conway's game of life implemented in C++ templates at compile time using Comonads.
*
* Logic based on: http://blog.emillon.org/posts/2012-10-18-comonadic-life.html
*/
#include <iostream>
/// Identity functor
template <typename X>
struct id {
@martinwicke
martinwicke / automobile.ipynb
Last active January 9, 2022 08:14
Estimator demo using Automobile dataset
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@stuartcarnie
stuartcarnie / main.m
Created March 4, 2011 19:59
Demonstrates we can now support limited JIT compilation on recent versions of iOS (assuming Apple approves entitlements at some future point)
//
// main.m
// ProtectTest
// Demonstrates newer versions of iOS now support PROT_EXEC pages, for just-in-time compilation.
//
// Must be compiled with Thumb disabled
//
// Created by Stuart Carnie on 3/4/11.
// Copyright 2011 Manomio LLC. All rights reserved.
//