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 | |
ob_start(); | |
var_dump($_POST); | |
$output = ob_get_clean(); | |
$outputFile = "var_dump_output.txt"; | |
$filehandle = fopen($outputFile, 'a') or die("File creation error.""); | |
fwrite($fileHandle, $output); | |
fclose($fileHandle); |
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
sed -e 's/\s*\([\+0-9a-zA-Z]*\).*/\1/' << EOF | gdisk /dev/sda | |
n # new partition | |
1 # partition number 1 | |
2048 # first sector | |
4095 # end sector | |
ef02 # BIOS boot partition | |
n # new partition | |
2 # partition number 2 | |
4096 # first sector | |
1028095 # end sector |
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
def request(linode_method, query_args = {}) | |
begin | |
args = { | |
api_key: @api_key, | |
api_action: linode_method, | |
}.merge(query_args).map{|k,v| "#{k}=#{v}"}.compact.join('&') | |
uri = URI("https://api.linode.com/?#{args}") | |
http = Net::HTTP.new(uri.host, uri.port) |
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
def deep_munge(hash) | |
hash.each do |k, v| | |
case v | |
when Array | |
v.grep(Hash) { |x| deep_munge(x) } | |
v.compact! | |
hash[k] = nil if v.empty? | |
when Hash | |
deep_munge(v) | |
end |
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 PasswordChange | |
include ActiveModel::Model | |
attr_accessor( | |
:user, | |
:current_password, | |
:new_password, | |
:new_password_confirmation, | |
) |
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(){ | |
$(".zoomable").click (function() { | |
if($(this).height() == 480){ | |
$(this).animate({ | |
height: '980', | |
width: '980' | |
}); | |
}else{ | |
$(this).animate({ | |
height: '480px', |
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
set -eux | |
set -o pipefail | |
# ! #<Blocks::Base::Builder:0x007f8b2d2f3ef0> ------------------------------------- | |
if [ ! -f /root/system_setup_complete ]; then | |
apt-get update | |
apt-get -y install aptitude | |
aptitude -y full-upgrade | |
fi | |
echo "wilmut.example.com" > /etc/hostname | |
hostname -F /etc/hostname |
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 | |
require 'fileutils' | |
require 'json' | |
DIRECTORY_NAME = '/Users/kaspergrubbe/Pictures/screenie/' | |
API_KEY = '' | |
URL = 'https://cdn.servnice.com/screenie' | |
unless File.directory?(DIRECTORY_NAME) |
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
def test | |
puts "Hello" | |
end | |
=> nil | |
Object.test | |
=> NoMethodError: private method 'test' called for Object:Class | |
Object.send(:test) | |
Hello |
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
<script> | |
var _adftrack = { | |
pm: 357733, | |
divider: encodeURIComponent('|'), | |
pagename: encodeURIComponent('Billetto 76303') | |
}; | |
(function () { var s = document.createElement('script'); s.type = 'text/javascript'; s.async = true; s.src = 'https://track.adform.net/serving/scripts/trackpoint/async/'; var x = document.getElementsByTagName('script')[0]; x.parentNode.insertBefore(s, x); })(); | |
</script> |