This file contains 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 | |
// echo exec('echo $PATH'); | |
// echo ' '; | |
// echo exec('whoami'); | |
// echo ' '; | |
// echo exec('ls -la /usr/local/sbin'); | |
// echo ' '; | |
// echo exec('ls -la /usr/local/bin'); | |
// echo ' '; |
This file contains 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
$(document).ready(function() { | |
var key = 'AIzaSyDt5uZerbNhxGA6nxGvgV0ul3ijJIIm_ok'; | |
var calID = 'hackatbrown.org_mguoo6bi9fdk79ruracndg3gjk@group.calendar.google.com'; | |
$.ajax({ | |
type: 'GET', | |
url: encodeURI('https://www.googleapis.com/calendar/v3/calendars/' + calID + '/events?key=' + key + '&singleEvents=true&orderBy=startTime'), | |
dataType: 'json', | |
success: function(response) { | |
response.items = response.items || []; |
This file contains 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
(function($){ | |
// Declare the rootUrl used for filtering internal links. | |
var rootUrl = document.location.protocol + '//' + (document.location.hostname || document.location.host) + (document.location.port ? ':' + document.location.port : '') + '/'; | |
// Helper functions | |
var getFragment = function(url, root) { // Grab the fragment and format it how Backbone expects | |
var fragment = url; | |
if (fragment.indexOf(':') !== -1) | |
fragment = fragment.replace(/.*:\/\/[^\/]+/, ''); | |
if (!fragment.indexOf(root)) fragment = fragment.substr(root.length); |
This file contains 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
LETTERS = "acdegilmnoprstuw" | |
def reverse(h, str) | |
if (h == 7) | |
return str.reverse | |
elsif (h < 7) | |
return false | |
end | |
if ((h % 1) != 0) |
This file contains 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 "PartyMix" | |
Shoes.app :width => 360, :height => 180, :scroll => false, :title => "Music Player" do | |
background firebrick..rgb(100, 0, 0) | |
@pm = PartyMix.new | |
stack do | |
@caption = para "Music Player by M-Dawg", :size => 18, :stroke => white | |
@status = para "No audio/ video file selected", :size => 12, :stroke => white |
This file contains 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
cars_found = 0 | |
2000.times do | |
# 0 = goat, 1 = car | |
doors = [0, 0, 0] | |
doors_indices = [0, 1, 2] | |
car_door = rand(0..2) | |
doors[car_door] = 1 |
This file contains 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
print "Number? " | |
num = gets.chomp.to_i | |
dict = { 1 => "I", 5 => "V", 10 => "X", 50 => "L", 100 => "C", 500 => "D", 1000 => "M" } | |
result = [] | |
[1000, 100, 10, 1].each do |n| | |
x = num % n | |
if x == num |
This file contains 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/bin/env ruby | |
# Usage: | |
# uicolorgenerate 0f84d5 | |
# to copy result to clipboard (on a Mac), use: | |
# uicolorgenerate 0f84d5 | pbcopy | |
def main(color_string) | |
case color_string | |
when "fff", "ffffff" |
This file contains 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 'faker' | |
namespace :db do | |
desc "Fill database with sample data" | |
task :populate => :environment do | |
Rake::Task['db:reset'].invoke | |
make_authors | |
make_sections | |
make_posts | |
make_comments |
This file contains 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
class Calculator | |
attr_accessor :exits | |
@@constant = 0.0000000000667 | |
def welcome | |
puts "\n<< Welcome >>\n\n" | |
puts 'type in "help" to see all available options' | |
end |
NewerOlder