Skip to content

Instantly share code, notes, and snippets.

View juliarose's full-sized avatar

Julia juliarose

  • United States
View GitHub Profile
00:00.0 Host bridge: Advanced Micro Devices, Inc. [AMD] RS880 Host Bridge
00:02.0 PCI bridge: Advanced Micro Devices, Inc. [AMD] RS780 PCI to PCI bridge (ext gfx port 0)
00:09.0 PCI bridge: Advanced Micro Devices, Inc. [AMD] RS780/RS880 PCI to PCI bridge (PCIE port 4)
00:0a.0 PCI bridge: Advanced Micro Devices, Inc. [AMD] RS780/RS880 PCI to PCI bridge (PCIE port 5)
00:11.0 SATA controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 SATA Controller [AHCI mode] (rev 40)
00:12.0 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB OHCI0 Controller
00:12.2 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB EHCI Controller
00:13.0 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB OHCI0 Controller
00:13.2 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB EHCI Controller
00:14.0 SMBus: Advanced Micro Devices, Inc. [AMD/ATI] SBx00 SMBus Controller (rev 42)
@juliarose
juliarose / color.rb
Created August 12, 2015 13:01
Ruby color module - for blending two colors, lightening colors, and darkening colors.
module Color
def self.to_hex(c) # convert decimal to hex
n = c.to_i.to_s(16)
n = '0' + n unless n.length > 1 # 2 characters
n
end
def self.to_dec(c) # convert hex to decimal
c.to_i(16)
end
@juliarose
juliarose / gist:e7556dac9433aa80f530
Created March 15, 2016 13:12
cat /proc/cpuinfo
processor : 0
vendor_id : AuthenticAMD
cpu family : 16
model : 4
model name : AMD Phenom(tm) II X4 965 Processor
stepping : 3
microcode : 0x10000c8
cpu MHz : 800.000
cache size : 512 KB
physical id : 0
#---------------------------------------------
# TINT2 CONFIG FILE
#---------------------------------------------
# For more information about tint2, see:
# http://code.google.com/p/tint2/wiki/Welcome
#
# For more config file examples, see:
# http://crunchbanglinux.org/forums/topic/3232/my-tint2-config/
# Background definitions
/*
For use on backpack.tf inventory pages only.
Used for converting any type of value (string, jQuery object, number)
to an easy to use interface for working with prices.
Usage:
@juliarose
juliarose / getUrlParam.js
Created April 4, 2019 13:24
Simple method for getting the value of a URL parameter
/**
* Get a URL parameter
* @param {String} name - Name of parameter
* @returns {(String|null)} The value of parameter, if found
*/
function getUrlParam(name) {
return new URL(location.href).searchParams.get(name);
}
@juliarose
juliarose / cookie.js
Created April 19, 2019 09:50
basic get/set cookie
/**
* Group an array by value from key
* @param {Array} arr - Array
* @param {(String|Function)} key - Key to take value from
* @returns {Object} Object of groups
*/
function groupBy(arr, key) {
// if 'key' is a function, set fn to 'key'
let fn = typeof key === 'function' ? key : null;
/**
* Partition array based on conditions
* @param {Array} arr - Array
* @param {Function} fn - Function to satisfy
* @returns {Array} Partitioned array
*/
function partition(arr, fn) {
let result = [[],[]];
for (let i = 0; i < arr.length; i++) {
@juliarose
juliarose / queryString.js
Created April 23, 2019 17:45
Resursive convert object to querystring in the format - numfruits=2&fruits[banana]=yellow&fruits[watermelon]=red&arr[]=first&arr[]=second
/**
* Convert query object to string
* @param {Object} query - Object
* @returns {String} Query string
*/
function queryString(query) {
let encode = encodeURIComponent;
/**
* Flatten an array