Skip to content

Instantly share code, notes, and snippets.

@orieken
orieken / jasmine.html
Created March 11, 2021 23:48 — forked from ike18t/jasmine.html
Jasmine in HTML file
<html>
<head>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jasmine/3.6.0/jasmine.min.css" integrity="sha512-VmXOc/75WLdJSABvh3ovbpXUxqO/tyW29GcmNZz0sRwQHRqBIAq61kAGITx5v2YPuvG07y8m522WVYKpRB6rxw==" crossorigin="anonymous" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/jasmine/3.6.0/jasmine.min.js" integrity="sha512-hSiRgmBWJ4Up/wGCaolTZ6HaOgkzTwS2Z4vQWY9jqDK8Tov+GzQKy0PcgIYoOi1WtZ3+hWNkgSDMyGaMGb4ybg==" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jasmine/3.6.0/jasmine-html.min.js" integrity="sha512-p/nVZroN9H1CSaY3Dh8HVfoaI0qhL6a9FuszMYFfUeLrGTHIi73gG0kc31xlL9KEwYT0tLox6nEsJfYwQebuvA==" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jasmine/3.6.0/boot.min.js" integrity="sha512-uVTH4+dZ7oHLKN3wMAPltsPuVOgfORZSUelvr7HWJmSsazBJKgUNTRSm+bUJ3IfKkG4Y1nLFr0qRX8oFS2fbZg==" crossorigin="anonymous"></script>
<script>
describe('jasmine', () => {
@orieken
orieken / GIF-Screencast-OSX.md
Created October 5, 2020 23:23 — forked from dergachev/GIF-Screencast-OSX.md
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@orieken
orieken / gist:12e768bea05c2b5a609b750bb90d4aac
Created September 3, 2017 02:48 — forked from akomakom/jenkins-groovy-system-script.groovy
A jenkins script to clean up workspaces on slaves. On all slaves with less than X free GB, this script removes /slaves/workspace/* if slave is idle. If not idle, it removes /full/job/workspace/path for each job that isn't currently running.
/**
Jenkins System Groovy script to clean up workspaces on all slaves.
Check if a slave has < X GB of free space, perform cleanup if it's less.
If slave is idle, wipe out everything in the workspace directory as well any extra configured directories.
If slave is busy, wipe out individual job workspace directories for jobs that aren't running.
Either way, remove custom workspaces also if they aren't in use.
**/
import hudson.model.*;
@orieken
orieken / gist:86ec5346ea51070e0fd07caac2169ba8
Created September 3, 2017 02:48 — forked from rb2k/gist:8372402
A jenkins script to clean up workspaces on slaves
// Check if a slave has < 10 GB of free space, wipe out workspaces if it does
import hudson.model.*;
import hudson.util.*;
import jenkins.model.*;
import hudson.FilePath.FileCallable;
import hudson.slaves.OfflineCause;
import hudson.node_monitors.*;
for (node in Jenkins.instance.nodes) {
@orieken
orieken / jenkins_setup.sh
Created July 17, 2017 11:39 — forked from gouravtiwari/jenkins_setup.sh
Jenkins setup on SUSE
# 1. Install jenkins
sudo zypper addrepo http://pkg.jenkins-ci.org/opensuse/ jenkins
sudo zypper install jenkins
# You would be asked something like this:
# Do you want to reject the key, trust temporarily, or trust always? [r/t/a/?] (r): t
# Overall download size: 115.9 MiB. After the operation, additional 159.9 MiB will be used.
# Continue? [y/n/?] (y): y
# 2. Start jenkins
sudo /etc/init.d/jenkins start
@orieken
orieken / download-progress.rb
Created March 21, 2017 21:23 — forked from Burgestrand/download-progress.rb
Ruby HTTP file download with progress measurement
require 'net/http'
require 'uri'
def download(url)
Thread.new do
thread = Thread.current
body = thread[:body] = []
url = URI.parse url
Net::HTTP.new(url.host, url.port).request_get(url.path) do |response|
@orieken
orieken / download-progress.rb
Created March 21, 2017 21:19 — forked from gutenye/download-progress.rb
Ruby HTTP file download with progress measurement
require 'net/http'
def download(url)
Thread.new do
thread = Thread.current
thread[:body] = []
thread[:done] = 0
url = URI(url)
Net::HTTP.new(url.host, url.port).get2(url.path) do |res|
@orieken
orieken / Gemfile
Created March 21, 2017 21:19 — forked from petems/Gemfile
An example http download with Progress Bar output in the command line with Ruby and the native `net/http` library...
source "https://rubygems.org"
gem "progressbar"
@orieken
orieken / Gemfile
Created March 21, 2017 21:19 — forked from petems/Gemfile
An example http download with Progress Bar output in the command line with Ruby and the native `net/http` library...
source "https://rubygems.org"
gem "progressbar"
@orieken
orieken / gist:4b9fcb48fc4353232691c97a166d1919
Created December 16, 2016 21:08 — forked from tonymtz/gist:d75101d9bdf764c890ef
Uninstall nodejs from OSX Yosemite
# first:
lsbom -f -l -s -pf /var/db/receipts/org.nodejs.pkg.bom | while read f; do sudo rm /usr/local/${f}; done
sudo rm -rf /usr/local/lib/node /usr/local/lib/node_modules /var/db/receipts/org.nodejs.*
# To recap, the best way (I've found) to completely uninstall node + npm is to do the following:
# go to /usr/local/lib and delete any node and node_modules
cd /usr/local/lib
sudo rm -rf node*