- Oliver Heaviside
- Linus
- Bigwig
- Barclay
- Toshiro Mifune
- Aslak
- Labeau
- Bombur
- Bjorn
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<php | |
$stmt = $mysqli->prepare("select * from sv_surveys where id=?"); | |
$stmt->bind_param("i", $edt); | |
$stmt->execute(); | |
$res = $stmt->get_result(); | |
if($getQuery = $res->fetch_assoc()) { | |
// Do it! | |
} | |
$stmt->close() | |
?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Implements hook_form_form_id_alter(). | |
*/ | |
function dance_code_form_dance_code_session_request_form_alter(&$form, &$form_state, $form_id) { | |
$form['#validate'][] = 'dance_code_session_request_form_validate'; | |
} | |
/** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<VirtualHost *:80> | |
ServerName www.testsinatra.com | |
DocumentRoot /websites/testsinatra/public | |
<Directory /websites/testsinatra> | |
Allow from all | |
Options -MultiViews | |
# Uncomment this if you're on Apache >= 2.4: | |
Require all granted | |
</Directory> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'csv' | |
User = Struct.new(:name, :email, :country) | |
users = [] | |
CSV.foreach("./users.csv", headers: true) do |row| | |
# skip blank rows | |
next unless row["Name"] | |
users << User.new(row["Name"], row["Email Address"], row["Country"]) | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for user in $(cut -f1 -d: /etc/passwd) | |
do | |
echo $user | |
crontab -u $user -l | |
done | |
# from http://stackoverflow.com/questions/134906/how-do-i-list-all-cron-jobs-for-all-users?rq=1 |
This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.
###Array ####Definition:
- Stores data elements based on an sequential, most commonly 0 based, index.
- Based on tuples from set theory.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'sinatra' | |
require 'action_mailer' | |
class Mailer < ActionMailer::Base | |
def contact | |
mail( | |
:to => "[email protected]", | |
:from => "[email protected]", | |
:subject => "Test") do |format| | |
format.text |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/ruby | |
require 'csv' | |
require 'bigdecimal' | |
filename = ARGV[0] | |
# split filename to get name and extension | |
(base, ext) = filename.split(/\./) | |
# create output file name | |
newf = "#{base}-processed.#{ext}" |