Skip to content

Instantly share code, notes, and snippets.

@smazhara
smazhara / Blank snippet.WORD.yaml
Last active Nov 28, 2019
Create a new snippet from a blank template.
View Blank snippet.WORD.yaml
name: Blank snippet
description: Create a new snippet from a blank template.
host: WORD
api_set: {}
script:
content: |
$("#run").click(() => tryCatch(run));
async function run() {
await Word.run(async (context) => {
View gist:5008318
thin » siege http://neon-stan.herokuapp.com/api/v1/apps -r10 -c25 ** SIEGE 2.72
** Preparing 25 concurrent users for battle. The server is now under siege.. done.
View gist:4741102
require "openssl"
require "base64"
include Base64
plain_text = "The beatings will continue until morale improves"
seckey = OpenSSL::PKey::RSA.new(1024)
pubkey = seckey.public_key
@smazhara
smazhara / gist:4740692
Last active May 16, 2021
Ruby AES128 encrypt-decrypt example
View gist:4740692
require "openssl"
require "base64"
include Base64
@smazhara
smazhara / rspec string_spec.rb
Created Jun 6, 2012
rspec's should_receive with implicit subject
View rspec string_spec.rb
» rspec string_spec.rb
F
Failures:
1) String
Failure/Error: it { should_receive(:size) }
(#<RSpec::Core::ExampleGroup::Nested_1:0x000000013e67b8>).size(any args)
expected: 1 time
received: 0 times
View satrap
#!/usr/bin/env script/runner
# vim:ft=ruby
#
# Script runs endless loop, picks least recently updated wmid, pulls its
# Customer, performs complete import rests 1 second and repeats.
#
# Start:
#
# app/bin/satrap
#
View gist:873263
<?php
require_once 'Benchmark/Timer.php';
$timer = new Benchmark_Timer;
$timer->setMarker('start');
for($i = 0; $i < 1000000; $i++)
{
$stack = array();
$stack[] = true;
We couldn’t find that file to show.