Skip to content

Instantly share code, notes, and snippets.

View mliq's full-sized avatar

Michael Liquori mliq

View GitHub Profile
func greeting(person: String) -> (greeting: String, language: String) {
let language = "English"
let greeting = "Hello \(person)"
return (greeting, language)
}
greeting("Tom")
//Access only the language value:
let (person,_) = greeting("Tom")
println(person)
@mliq
mliq / gist:8c6ca3db2f684a83cf95
Created October 31, 2014 19:17
Headphone Repair
http://www.howtogeek.com/62999/how-to-replace-a-stereo-connector-and-salvage-audio-cables-and-headphones/
http://www.instructables.com/id/Replacing-the-jack-on-a-pair-of-headphones/?ALLSTEPS
-
http://en.wikipedia.org/wiki/Phone_connector_(audio)
http://www.instructables.com/id/1-How-to-Repair-or-Fix-Headphones-Headphone-Jack/
http://www.overclock.net/t/1388819/is-it-possible-to-fix-a-bent-headphone-jack
https://www.google.com/search?client=opera&q=Neutrik+make+some+nice+aftermarket+jacks.&sourceid=opera&ie=UTF-8&oe=UTF-8
@mliq
mliq / Ruby Variable Types Demo
Last active August 29, 2015 14:12
Demonstration of different Variable types in Ruby
$x = false # This is a global variable
class MyBurger
TOPPING = "something" #this is a constant, always UPPERCASE
def order
number = "something" #this is a local variable, only accessible in this function. Usually
end
def initialize
@mliq
mliq / test.rb
Last active August 29, 2015 14:12
Basic Ruby Class and Hello World (Treehouse)
3.times {puts 'Hello World'}
class BankAccount
def initialize(name)
@transactions = []
@balance = 0
end
def deposit
@mliq
mliq / test.rb
Created December 23, 2014 18:19
gets name, string length
def namer
puts "name?"
name=gets.chomp
puts "#{name.length} is length"
if name.length>25
puts "Greater than 25"
end
end
namer()
@mliq
mliq / stylesheet.css
Created April 26, 2015 19:14
Possible fix for Vince
.displayGroups {
display: flex;
justify-content:center;
margin: 0 20%;
height: auto;
width: auto;
/*margin-left: 30%;*/
/*margin-right: auto;*/
padding: 15px;
border-radius: 15px;
@mliq
mliq / app.js
Last active August 29, 2015 14:23
Desk Object
function Desk(number, position, person, classroom){
this.number = number;
this.position = position;
this.person = person;
this.classroom = classroom;
};
@mliq
mliq / LICENSE
Last active August 29, 2015 14:27 — forked from ourmaninamsterdam/LICENSE
Arrayzing - The JavaScript array cheatsheet
The MIT License (MIT)
Copyright (c) 2015 Justin Perry
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
@mliq
mliq / ril_to_instapaper.rb
Created June 11, 2016 22:46 — forked from bobes/ril_to_instapaper.rb
Import your ReadItLater bookmarks into Instapaper
#!/usr/bin/env ruby
# 1. export your RIL bookmarks
# 2. save this file to the same directory where your ril_export.html is
# 3. change username and password in the script bellow
# 4. run 'ruby ril_to_instapaper.rb' in terminal
require "cgi"
require "net/http"
require "net/https"
@mliq
mliq / dropbox_youtube_dl.sh
Created June 14, 2016 22:18
The script to do the downloading part for http://ifttt.com/myrecipes/personal/1525639
### Run this script via a cronjob every (every minute or so) on a server that has access to your dropbox.
### You must install youtube-dl (http://rg3.github.com/youtube-dl/) for this to work.
#!/bin/bash
QUEUE_DIR=~/Desktop/Dropbox/IFTTT/youtube-dl/*.txt
VIDEO_DIR=~/Desktop/Dropbox/youtube/
shopt -s nullglob
for queue_file in $QUEUE_DIR
do
video_url=`cat "$queue_file"`;