Skip to content

Instantly share code, notes, and snippets.

item_subtotal = 465.777
item_subtotal = 465.77
employee_discount = 46.58
monitor_price = 396.77
adapter_price = 69.00
monitor_price_ratio = monitor_price / item_subtotal
adapter_price_ratio = adapter_price / item_subtotal
monitor_discount = monitor_price_ratio * employee_discount
adapter_discount = adapter_price_ratio * employee_discount
monitor_discount = 39.67955557463984
@jophde
jophde / grubconfig
Created February 13, 2020 07:18
passthrough config
# GRUB boot loader configuration
GRUB_DEFAULT='Advanced options for Arch Linux>Arch Linux, with Linux linux'
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="Arch"
GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on intel_pstate=disable default_hugepagesz=1G hugepagesz=1G hugepages=8 kvm.nx_huge_pages=off intremap=no_x2apic_optout"
GRUB_CMDLINE_LINUX=""
# Preload both GPT and MBR modules so that they are not missed
GRUB_PRELOAD_MODULES="part_gpt part_msdos"

Keybase proof

I hereby claim:

  • I am jophde on github.
  • I am jophde (https://keybase.io/jophde) on keybase.
  • I have a public key whose fingerprint is EE49 BC99 0750 8888 D2A4 3019 543C 928F EA35 B663

To claim this, I am signing this object:

"aTimeTags": {
"36960": {
"idTimeTag": "36960",
"idVenue": "10",
"iStartHour": "4",
"iEndHour": "11",
"sName": "Morning",
"sAddDate": "2012-12-04 07:05:14"
},
"36961": {
@jophde
jophde / Yelp.txt
Created October 30, 2012 21:20
IRB Yelp Gem Dump
irb(main):001:0> require 'yelp'
SyntaxError: /usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/yelp-1.0.0/lib/yelp/request.rb:37: syntax error, unexpected ':', expecting keyword_then or ',' or ';' or '\n'
when Yelp::ResponseFormat::PICKLE: params[:output] = 'pickle'
^
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/yelp-1.0.0/lib/yelp/request.rb:38: syntax error, unexpected keyword_when, expecting keyword_end
when Yelp::ResponseFormat::PHP: params[:output] = 'php'
^
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/yelp-1.0.0/lib/yelp/request.rb:38: syntax error, unexpected ':'
when Yelp::ResponseFormat::PHP: params[:output] = 'php'
^
@jophde
jophde / Server.java
Created January 2, 2012 21:30
Singleton
package com.roqbot.client;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
@jophde
jophde / MyBasicAdapter.java
Created November 9, 2011 22:46
ListView Adapter
private class VenuesAdapter extends BaseAdapter implements ListAdapter {
private final JSONArray venues;
private VenuesAdapter(JSONArray venues) {
assert venues != null;
this.venues = venues;
}
private class VenuesAdapter extends BaseAdapter implements ListAdapter {
private JSONArray venues;
private VenuesAdapter(JSONArray venues) {
assert venues != null;
this.venues = venues;
}
@Override
public void fillShelves() {
setContentView(R.layout.records);
LayoutInflater mLayoutInflater = getLayoutInflater();
int i = 0;
while (i != Records.this.aData.length()) {
LinearLayout recordShelves = (LinearLayout) mLayoutInflater.inflate(R.layout.record_shelf,
(ViewGroup) findViewById(R.id.records));
LinearLayout recordShelf = (LinearLayout) recordShelves.getChildAt(recordShelves.getChildCount() - 1);
ImageButton record;
@jophde
jophde / dashboard.css
Created March 12, 2011 19:50
prototype for dashboard
#dashboard {
border: 3px solid;
width: auto;
float:left;
}
#incoming {
border: 2px solid;
padding: 10px 10px 10px 10px;
margin: 10px 5px 10px 10px;
width: 200px;