Skip to content

Instantly share code, notes, and snippets.

View jheidt's full-sized avatar
💭
:shipit: 👍

Jake jheidt

💭
:shipit: 👍
View GitHub Profile
@lhw
lhw / pom.xml
Created August 30, 2012 12:26
maven file with sqlite4java
<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>de.ring0.lhw</groupId>
<artifactId>system</artifactId>
<version>0.0.1-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>com.almworks.sqlite4java</groupId>
<artifactId>sqlite4java</artifactId>
anonymous
anonymous / DeliriousGreenOxpecker.c
Created March 3, 2018 05:15
DeliriousGreenOxpecker created by Mdhi - https://repl.it/@Mdhi/DeliriousGreenOxpecker
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#ifdef _MSC_VER
#include <intrin.h> /* for rdtscp and clflush */
#pragma optimize("gt",on)
#else
#include <x86intrin.h> /* for rdtscp and clflush */
#endif
@havenwood
havenwood / producer-consumer.rb
Created May 14, 2013 01:14
Producer-consumer problem in Ruby with SizedQueue
require 'thread'
class ProducerConsumer
def initialize producers = 5, consumers = 5, queue_size = 5
@producers, @consumers = producers, consumers
@queue = SizedQueue.new queue_size
@mutex = Mutex.new
@threads = []
end
@leemour
leemour / FontFix RubyMine
Last active October 6, 2018 06:42
Fixing font anti-aliasing for Ubuntu.
# Change Java Runtime:
sudo update-alternatives --config java
# Delete Open-JDK
sudo apt-get purge openjdk-\* icedtea-\* icedtea6-\*
# Change fonts - remove hinting:
http://askubuntu.com/questions/32624/ugly-fonts-in-netbeans-how-can-i-make-it-use-the-system-font
# Change RubyMine AntiAliasing first:
@nmcv
nmcv / bash_xor.txt
Created February 1, 2013 11:02
Quick XOR of hexadecimal strings for BASH
# BASH function to get the result
# of a ^ b when a, b are in the
# following hexadecimal string
# form: AF396463D8705 ...
# Obtained from here:
# http://www.codeproject.com/Tips/470308/XOR-Hex-Strings-in-Linux-Shell-Script
# Author is Sanjay1982 (see http://www.codeproject.com/Members/Sanjay1982)
# Usage:
@tnolet
tnolet / gist:7361441
Last active December 5, 2018 02:48
Install collectd 5.4 on Centos 6.x and make it spit out cool metrics. Copied from http://linuxdrops.com/install-collectd-statistics-collecter-on-centos-rhel-ubuntu-debian/ and tweaked for your and my pleasure. For all other cool options, check the provided link.
#!/bin/bash
# Perform installation as root
# Install prereqs
yum -y install libcurl libcurl-devel rrdtool rrdtool-devel rrdtool-prel libgcrypt-devel gcc make gcc-c++
# Get Collectd, untar it, make it and install
wget http://collectd.org/files/collectd-5.4.0.tar.gz
tar zxvf collectd-5.4.0.tar.gz
@fairchild
fairchild / bundle-to-ebs.sh
Created December 5, 2009 23:32
2 scripts that can be used to create an bootable EBS from a running instance. ami-4205e72b created with this process
#!/bin/bash -xe
EBS_DEVICE='/dev/sdh'
INSTANCE_ID=$1
AKI=${2:-'aki-5f15f636'}
ARI=${3:-'ari-0915f660'}
ARCH=${4:-'i386'}
SIZE=${5:-10}
AZ=${6:-'us-east-1d'}
NAME=${7:-"ami-from-$INSTANCE_ID"}
<script src="https://threejs.org/build/three.min.js"></script>
<script src="https://threejs.org/examples/js/utils/BufferGeometryUtils.js"></script>
<script src="https://threejs.org/examples/js/controls/OrbitControls.js"></script>
<script>
var noise = `
//
// Description : Array and textureless GLSL 2D/3D/4D simplex
// noise functions.
// Author : Ian McEwan, Ashima Arts.
// Maintainer : stegu
@jstorimer
jstorimer / hilong.rb
Last active July 30, 2020 06:52
hilong -- A simply utility to show character counts for each line of input and highlight lines longer than 80 characters.
#!/usr/bin/env ruby
# A simply utility to show character counts for each line of input and
# highlight lines longer than 80 characters.
#
# Written as an example for http://jstorimer.com/2011/12/12/writing-ruby-scripts-that-respect-pipelines.html
#
# Examples:
#
# $ hilong Gemfile
@patrick-fischer
patrick-fischer / AWS.cls
Last active April 7, 2021 15:01
AWS Authentication using Query Parameters (AWS Signature Version 4): https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-query-string-auth.html
/**
// Example implementation as follows:
public class AWSS3_GetService extends AWS {
public override void init() {
resource = '/[your bucket]/[your folder 1]/[your folder 2]/[file name].[extension]';
region = 'eu-west-2';
service = 's3';
endpoint = new Url('https://' + service + '.' + region + '.amazonaws.com/');
accessKey = 'SET HERE';
method = HttpMethod.XGET;