Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

diskutil list

diskutil eraseDisk JHFS+ Emptied /dev/disk2

hdiutil convert -format UDRW -o ~/Downloads/linuxmint-19-xfce-64bit-v2 ~/Downloads/linuxmint-19-xfce-64bit-v2.iso

diskutil unmountDisk /dev/disk2

sudo dd if=/Users/cj/Downloads/linuxmint-19-xfce-64bit-v2.dmg of=/dev/rdisk2 bs=1m

@johnsonch
johnsonch / blogpost.css
Created November 1, 2015 02:03
php fall 2015 lab 9 css
/*!
* Start Bootstrap - Blog Post HTML Template (http://startbootstrap.com)
* Code licensed under the Apache License v2.0.
* For details, see http://www.apache.org/licenses/LICENSE-2.0.
*/
body {
padding-top: 70px; /* Required padding for .navbar-fixed-top. Remove if using .navbar-static-top. Change if height of navigation changes. */
}
@johnsonch
johnsonch / index.php
Last active November 1, 2015 02:04
php fall 2015 lab 9 start index.php
<?php
require_once('madlibs.php');
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
@johnsonch
johnsonch / Gemfile
Last active October 1, 2015 18:47
2015 MATC Fall Ruby on Rails Gemfile
source 'https://rubygems.org'
gem 'rails', '4.2.1'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.1.0'
gem 'jquery-rails'
gem 'turbolinks'
@johnsonch
johnsonch / show.html.erb
Created April 16, 2015 19:01
Wolfie's List - Show page markup for week 12
<div class="col-lg-4">
<p id="notice"><%= notice %></p>
<p>
<strong>Title:</strong>
<%= @ad.title %>
</p>
<p>
<strong>Description:</strong>
@johnsonch
johnsonch / generate_fake.rake
Created April 16, 2015 18:34
Custom rake tasks for class example
namespace :generate_data do
desc "generate some test categories"
task :categories => :environment do
25.times do
Category.create(:name => Faker::Commerce.department)
end
end
desc "generate some test users"
task :users => :environment do
@johnsonch
johnsonch / gist:2f9f65f5b06aaa55cad4
Created April 15, 2015 23:10
match_all_class_example.php
<?php
$string = 'My lovely gloves are lost in the clover, Love.';
$result = preg_match_all('/(\w*lo\w*)/i', $string, $matches);
if ($result == true) {
print "Found $result matches<br />";
}
else {
print 'Didn\'t find a match<br />';
}
$match_results = $matches[0];
@johnsonch
johnsonch / myclass.php
Created March 30, 2015 16:23
PHP getter and setter example for class
<?php
class myClass{
private $propertyA
private $propertyB
public function getPropertyA(){
return $this->propertyA;
}
public function setPropertyA($value){
@johnsonch
johnsonch / car.php
Created March 26, 2015 04:40
Simple PHP class example for class
class Car{
public $make;
public $model;
public function getMake(){
return $this->make;
}
public function setMake($input_make){
$this->make = $input_make;
@johnsonch
johnsonch / fizzbuzz.php
Created March 3, 2015 21:11
for class fizzbuzz example
<?php
function generate_output($value){
if (is_fizz($value) && !is_buzz($value)){
return "fizz";
}
if (is_buzz($value) && !is_fizz($value)){
return "buzz";
}