Skip to content

Instantly share code, notes, and snippets.

View 9prady9's full-sized avatar
🏠
Working from home

Pradeep Garigipati 9prady9

🏠
Working from home
View GitHub Profile
@9prady9
9prady9 / perlin_noise.cpp
Last active February 13, 2017 16:28
C++ Program using ArrayFire that show cases Perlin Noise Generation using GPU.
/*******************************************************
* Copyright (c) 2017, ArrayFire
* All rights reserved.
*
* This file is distributed under 3-clause BSD license.
* The complete license agreement can be obtained at:
* http://arrayfire.com/licenses/BSD-3-Clause
********************************************************/
#include <arrayfire.h>
@9prady9
9prady9 / spectral_colors.rs
Last active November 17, 2016 17:06
Rust snippet to generate visible spectrum colours based on wavelength
static GAMMA: f64 = 0.80;
static INTENSITY_MAX: f64 = 255.0;
static MAX_WVL: f64 = 780.0;
static MIN_WVL: f64 = 380.0;
/** Taken from Earl F. Glynn's web page:
* <a href="http://www.efg2.com/Lab/ScienceAndEngineering/Spectra.htm">Spectra Lab Report</a>
* */
pub fn wavelength_to_rgb(wavelength: f64) -> (u32, u32, u32) {
@9prady9
9prady9 / cpuinfo.cpp
Created September 15, 2015 18:32
Sample code to extract cpu information using CPUID instruction
#include <algorithm>
#include <iostream>
#include <string>
#ifdef _WIN32
#include <limits.h>
#include <intrin.h>
typedef unsigned __int32 uint32_t;
#else
#include <stdint.h>
#!/bin/sh
# i3-get-window-criteria - Get criteria for use with i3 config commands
# To use, run this script, then click on a window.
# Output is in the format: [<name>=<value> <name>=<value> ...]
# Known problem: when WM_NAME is used as fallback for the 'title="<string>"' criterion,
# quotes in "<string>" are not escaped properly. This is a problem with the output of `xprop`,
# reported upstream: https://bugs.freedesktop.org/show_bug.cgi?id=66807
# i3status configuration file.
# see "man i3status" for documentation.
# It is important that this file is edited as UTF-8.
# The following line should contain a sharp s:
# ß
# If the above line is not correctly displayed, fix your editor first!
general {
colors = true
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout somewhen, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
# Please see http://i3wm.org/docs/userguide.html for a complete reference!