Skip to content

Instantly share code, notes, and snippets.

View JaDogg's full-sized avatar
🎧
Working on Yaksha Programming Language - yakshalang.github.io/

JaDoggx86 JaDogg

🎧
Working on Yaksha Programming Language - yakshalang.github.io/
View GitHub Profile
@thedavesims
thedavesims / palette.h
Last active October 21, 2022 16:25
Palette Previewer
struct palette {
int palette[4];
char name[255];
char author[255];
};
// Sampled from: https://lospec.com/palette-list
// Colors rearranged from lightest to darkest for consistency
struct palette lospec_palettes[] = {
{
@jeremyd2019
jeremyd2019 / pesubsys.c
Last active March 27, 2024 19:48
program to get and set subsystem in PE headers
#include <windows.h>
#include <stddef.h>
#include <stdio.h>
int main(int argc, char ** argv)
{
FILE * fh;
IMAGE_DOS_HEADER idh = {0};
DWORD signature = 0;
long subsys_offset = 0;
@Ph0enixKM
Ph0enixKM / color.cpp
Last active July 8, 2023 11:33
Cross Platform Terminal Color Output Library (Windows/Linux/Mac)
// Color Terminal Output Library
// MIT Licensed Library
// There are 6 colors:
//
// blue
// green
// cyan
// red
@juancarlospaco
juancarlospaco / sound_play_crossplatform.py
Last active June 28, 2021 20:59
Cross-platform Sound Playing with Standard Libs only, No Sound file is required, No install is required, Python2 / Python3.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os, sys
from tempfile import gettempdir
from subprocess import call
def beep(waveform=(79, 45, 32, 50, 99, 113, 126, 127)):
@leosuncin
leosuncin / README.md
Last active October 12, 2023 18:00
Install Powerline on Debian/Ubuntu
  1. Install pip sudo apt-get install python-pip or wget https://bootstrap.pypa.io/get-pip.py && sudo python get-pip.py
  2. Install powerline sudo pip install powerline-status
  3. Download and install fonts git clone https://github.com/powerline/fonts.git && cd fonts && sh ./install.sh
  4. Add this lines to respective file
    .vimrc

set rtp+=/usr/local/lib/python2.7/dist-packages/powerline/bindings/vim/
> " Always show statusline

@brecke
brecke / pyaudio on a rPi
Created January 27, 2015 22:04
How to install PyAudio on a Raspberry Pi
# taken from http://raspberrypihell.blogspot.pt/2013/07/pyaudio-and-how-to-install.html
sudo apt-get install git
sudo git clone http://people.csail.mit.edu/hubert/git/pyaudio.git
sudo apt-get install libportaudio0 libportaudio2 libportaudiocpp0 portaudio19-dev
sudo apt-get install python-dev
cd pyaudio
sudo python setup.py install
@jewelsea
jewelsea / WebViewConfirm.java
Created June 25, 2012 23:25
JavaFX WebView Modal Confirm Dialog Box Example
import javafx.application.Application;
import javafx.beans.property.BooleanProperty;
import javafx.beans.property.SimpleBooleanProperty;
import javafx.event.*;
import javafx.scene.Node;
import javafx.scene.Scene;
import javafx.scene.control.*;
import javafx.scene.effect.BoxBlur;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.*;
@hellerbarde
hellerbarde / latency.markdown
Created May 31, 2012 13:16 — forked from jboner/latency.txt
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

@jewelsea
jewelsea / HTMLEditorCustomizationSample.java
Created April 28, 2012 00:43
Customize the JavaFX HTMLEditor
import java.util.List;
import java.util.regex.Pattern;
import javafx.application.*;
import javafx.collections.FXCollections;
import javafx.event.*;
import javafx.scene.*;
import javafx.scene.control.*;
import javafx.scene.effect.*;
import javafx.scene.image.*;
import javafx.scene.web.HTMLEditor;
@jewelsea
jewelsea / CodeEditor.java
Created December 11, 2011 23:30
CodeMirror based code editor for JavaFX
import javafx.scene.layout.StackPane;
import javafx.scene.web.WebView;
/**
* A syntax highlighting code editor for JavaFX created by wrapping a
* CodeMirror code editor in a WebView.
*
* See http://codemirror.net for more information on using the codemirror editor.
*/
public class CodeEditor extends StackPane {