C:\Program Files (x86)\Steam\steamapps\common\Counter-Strike Global Offensive\csgo\cfg\config.cfg
unbindall
bind "0" "slot10"
bind "1" "slot1"
bind "2" "slot2"
bind "3" "slot3"
bind "4" "slot4"
def transposition_decrypter(key) | |
# Calculate the length of columns based on the message length and how many letters in this key attempt | |
col_length = (@encrypted_message.length) / key | |
answer = [] | |
group_count = 0 | |
groups = {} | |
# Create character groups for each column + 1 so we start at 1 for readability |
public ColorImage apply(ColorImage image) | |
{ | |
// Store the image objects width and height in local variables. | |
int image_width = image.getWidth(); | |
int image_height = image.getHeight(); | |
// Store all given fixed colours into array. | |
Color[] palette = new Color[8]; | |
palette[0] = new Color (0,0,0); | |
palette[1] = new Color (255,255,255); |
package com.example.tippers; | |
import java.math.BigDecimal; | |
import java.text.NumberFormat; | |
import android.os.Bundle; | |
import android.app.Activity; | |
import android.content.SharedPreferences; | |
import android.view.Menu; | |
import android.view.View; | |
import android.widget.Button; |
# Remove duplicate keys | |
array = [ Hash[ burger: 1], Hash[burger: 2, pie: 1] ] | |
array.reduce({}) do |result, department| | |
result.merge(department) do |key, left, right| | |
left + right | |
end | |
end | |
# {:burger=>3, :pie=>1} | |
# Override the right hash with the left |
lunch_list = %W[beer bread bananas] | |
dinner_list = %W[beer steak chips] | |
# Combining arrays whilst preserving uniqueness | |
lunch_list | dinner_list == (lunch_list + dinner_list).uniq | |
=> ["beer", "bread", "bananas", "steak", "chips"] | |
# Adding to an array whilst preserving uniqueness | |
lunch_list |= [ "cake" ] |
Dir.glob( Rails.root.join("lib", "ext", "*.rb") ).each { |f| require f } | |
or | |
config.autoload_paths << Rails.root.join('lib') |
hash = Hash[key: "value1", key: "value2"] | |
hash2 = Hash[key: "value1", anotherkey: "value2"] | |
array = [hash, hash2] | |
array.each { |hash| hash.inject({}) { |h, (k,v)| h[k] = "blue"; h} } |
#!/usr/bin/env ruby | |
require 'gosu' # gem install gosu --no-document | |
include Gosu | |
$dimension, $splits = 200, 20 | |
$size = $dimension.to_f / $splits.to_f | |
class Worm | |
attr_writer :dir | |
def initialize() reset end |
cert = OpenSSL::X509::Certificate.new(x) | |
fingerprint = OpenSSL::Digest::SHA1.new(cert.to_der).to_s | |
puts fingerprint.scan(/.{2}/).join(":").upcase |
C:\Program Files (x86)\Steam\steamapps\common\Counter-Strike Global Offensive\csgo\cfg\config.cfg
unbindall
bind "0" "slot10"
bind "1" "slot1"
bind "2" "slot2"
bind "3" "slot3"
bind "4" "slot4"