Skip to content

Instantly share code, notes, and snippets.

@smazhara
smazhara / Blank snippet.WORD.yaml
Last active November 28, 2019 20:19
Create a new snippet from a blank template.
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) => {
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.
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 19:55
Ruby AES128 encrypt-decrypt example
require "openssl"
require "base64"
include Base64
@smazhara
smazhara / rspec string_spec.rb
Created June 6, 2012 18:38
rspec's should_receive with implicit subject
» 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
#!/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
#
<?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.