Skip to content

Instantly share code, notes, and snippets.

Add-Type -assemblyName System.Windows.Forms;$a=@(1..100);while(1){[System.Windows.Forms.Cursor]::Position=New-Object System.Drawing.Point(($a|get-random),($a|get-random));start-sleep -seconds 5}
@wstrinz
wstrinz / elm-build-cache.mjs
Last active February 2, 2022 15:17 — forked from Janiczek/elm-build-cache.mjs
Build ~/.elm cache manually without checking SHA1 hashes
#!/usr/bin/env node
// the .mjs extension is important
// run this inside the directory containing the `elm.json` file
// (if it's not executable, run `chmod +x elm-build-cache.mjs`)
// with VERBOSE=1 env var it will show you results of the exec commands
import { promises } from "fs";
import { exec } from "child_process";
const fs = promises;
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDHFN/aa3cYI9LQ3n2VDv2viHR5XzjttCIn5I72VfGBZas/O2CrqokIuuJI79BznIb4+cWh+FlH8wMHMArlPzSSmPFmhIMwl8l6TVZwvCDJcqcxsRWfCeWfkySl7xhTn5HzrAy6BfWpOj3PwfUD/zQuZuQIcaHc0DIqvLG6RNXfv+YAuka6Lv+jCWWrOZrmg6qbJuxhEqd2T51TpBxoSthTQFAwGv2Csp8IKJ3F+8vs9spvMVcvpv+XwAeDYcpHGupRz87hAW87HfhEK5Hq6w4S9OLsSBBgd6qnLxKVXsCcS91eZjIDJs4ZVOYiUR429WTczYIKantsv5JgIFVi9Wgb wstrinz@DESKTOP-SSKFFKU
@wstrinz
wstrinz / sidekiq
Last active January 17, 2018 17:54 — forked from dyerc/sidekiq
Sidekiq init script - AMI compatible
#!/bin/bash
# sidekiq Init script for Sidekiq
# chkconfig: - 99 10
# description: Starts and Stops Sidekiq message processor for Stratus application.
#
# User-specified exit parameters used in this script:
#
# Exit Code 5 - Incorrect User ID
# Exit Code 6 - Directory not found
#!/bin/bash
#
# Bash script to setup headless Selenium (uses Xvfb and Chrome)
# (Tested on Ubuntu 12.04) trying on ubuntu server 14.04
# Add Google Chrome's repo to sources.list
echo "deb http://dl.google.com/linux/chrome/deb/ stable main" | tee -a /etc/apt/sources.list
# Install Google's public key used for signing packages (e.g. Chrome)
# (Source: http://www.google.com/linuxrepositories/)
https://images-1.gog.com/e76ef4db2728146be75f28249bf5dde2a6b36ba064c07869e4c21542a1fed182.jpg
http://ec1.images-amazon.com/images/I/4144F0Z4K8L._SS500_.jpg
@wstrinz
wstrinz / huginn_update_script.rb
Created June 1, 2016 04:04
quick script for huginn updating. needs original repo to have been cloned by root :(
run_cmd = ->(cmdstring) { puts cmdstring; puts `#{cmdstring}`}
puts '# You can also use [Capistrano](./capistrano.md) to keep your installation up to date.'
puts '### 0. Ensure depencies are up to date'
cmd_to_run = <<-EOCMD
cd /home/huginn/huginn
sudo bundle exec rake production:check
EOCMD
title: party_parrots
emojis:
- name: middleparrot
src: http://cultofthepartyparrot.com/parrots/middleparrot.gif
- name: aussieparrot
src: http://cultofthepartyparrot.com/parrots/aussieparrot.gif
@wstrinz
wstrinz / get_count_of_all_models.rb
Last active December 14, 2015 15:37
get count of all models in rails
Rails.application.eager_load!
getCounts = ->(model) { {model.to_s => model.try(:count) || "cant count" } }
ActiveRecord::Base.descendants.map(&getCounts)