Skip to content

Instantly share code, notes, and snippets.

smartctl 6.6 2017-11-05 r4594 [Darwin 17.4.0 x86_64] (local build)
Copyright (C) 2002-17, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Model Family: Hitachi Ultrastar 7K3000
Device Model: Hitachi HUA723020ALA641
Serial Number: YFG86ELA
LU WWN Device Id: 5 000cca 223c3bb23
Firmware Version: MK7OA840
User Capacity: 2,000,398,934,016 bytes [2.00 TB]
@bbonamin
bbonamin / Brewfile
Last active August 18, 2024 09:26
Capybara Selenium Webdriver: Headless Chrome (with file downloads!) & Headless Firefox
tap "caskroom/cask"
cask "google-chrome"
cask "firefox"
brew "chromedriver"
brew "geckodriver"
@sathiyaseelan
sathiyaseelan / Selenium_with_headless_chrome.md
Created November 22, 2017 04:29 — forked from sathya-moneysmart/Selenium_with_headless_chrome.md
Capybara Setup for selenium with headless chrome

Setup for Capybara selenium with headless chrome

This gist contains all you need to setup capybara for selenium with headless chrome.

  1. Add these gems to the Gemfile under test group
  gem 'capybara'
  gem 'chromedriver-helper
  gem 'selenium-webdriver'
@n1ru4l
n1ru4l / ArtistList.js
Created January 24, 2017 15:42
mobx + apollo-client + react
import React from 'react'
import { observer } from 'mobx-react'
function ArtistList({ uiState: { artistData } }) {
const { data } = artistData;
if ( !data || !data.artists || !data.artists.length ) {
return <div>No artists bruh.</div>
}
const { artists } = data
return (
@prog1dev
prog1dev / gist:62660be194ce4aec73721a0af1665983
Last active April 29, 2020 12:48
download_zip method without temp files
def download_zip(image_list)
unless image_list.blank?
file_name = 'pictures.zip'
stringio = Zip::ZipOutputStream::write_buffer do |z|
image_list.each do |img|
title = img.title
title += '.jpg' unless title.end_with?('.jpg')
z.put_next_entry(title)

Basic

import code; code.interact(local=locals())

Advanced

IPython with embed()

@rrgayhart
rrgayhart / package-management.markdown
Last active March 25, 2016 18:52
The Dangers of Using Code You Don't Control
@aghuddleston
aghuddleston / csv_for_excel.rb
Last active August 10, 2022 19:19
Write a CSV file using Ruby 2.2.2 which can open in Excel, properly displaying accents.
require 'csv'
module DownloadService
OPEN_MODE = "w+:UTF-16LE:UTF-8"
BOM = "\xEF\xBB\xBF" #Byte Order Mark
def student_list
File.open("#{file_name}.tsv", OPEN_MODE) do |f|
csv_file = CSV.generate({:col_sep => "\t"}) do |csv|
# header row
@adomokos
adomokos / core_test.clj
Created May 15, 2015 18:53
Solving the Roman Numeral Kata in Clojure
(ns roman-numerals.core-test
(:require [clojure.test :refer :all]))
(def mapping {
0 ""
1 "I"
4 "IV"
5 "V"
9 "IX"
10 "X"
/**
* Ref $elector Mixin
*/
export default {
$(ref) {
return this.refs[ref].getDOMNode()
}
}