Skip to content

Instantly share code, notes, and snippets.

View mrjcleaver's full-sized avatar

Martin Cleaver mrjcleaver

View GitHub Profile
@rkumar
rkumar / gist:445735
Created June 20, 2010 10:47
ruby's OptionParser to get subcommands
#!/usr/bin/env ruby -w
## Using ruby's standard OptionParser to get subcommand's in command line arguments
## Note you cannot do: opt.rb help command
## other options are commander, main, GLI, trollop...
# run it as
# ruby opt.rb --help
# ruby opt.rb foo --help
# ruby opt.rb foo -q
# etc
@obscurerichard
obscurerichard / README.md
Created September 17, 2012 22:35
Simulates a low bandwidth, high-latency network connection

slow

This bash script offers quick shortcuts to simulate slower network connections. It is useful when you need to simulate a wireless network on a Linux network server, especially when you are using a virtual machine guest on your local machine or in the cloud.

slow 3G                   # Slow network on default eth0 down to 3G wireless speeds
slow reset                # Reset connection for default eth0 to normal
slow vsat --latency=500ms # Simulate satellite internet  with a high latency
slow dsl -b 1mbps         # Simulate DSL with a slower speed than the default

slow modem-56k -d eth0 # Simulate a 56k modem on the eth1 device. eth0 is unchanged.

@bjacobowski
bjacobowski / DevBuild.txt
Last active November 24, 2023 17:43
Boxstarter
try {
Install-WindowsUpdate -AcceptEula
Update-ExecutionPolicy Unrestricted
Move-LibraryDirectory "Personal" "$env:UserProfile\google drive\documents"
Set-ExplorerOptions -showHidenFilesFoldersDrives -showProtectedOSFiles -showFileExtensions
Set-TaskbarSmall
Enable-RemoteDesktop
#utilities
cinst 7zip
@ThinkSalat
ThinkSalat / Readwise to Raindrop.js
Last active October 31, 2023 20:11
Syncs your Readwise documents, highlights and annotations to Raindrop. automatically adds new highlights and annotations. Set up the config using the tokens from readwise and raindrop, and leave LASTUPDATE blank as it will gather all your documents and add them to the raindrop collection on the first run. Find RAINDROPCOLLECTIONID using this htt…
const fs = require('fs');
const path = require('path');
const filePath = path.join(__dirname, 'config.txt');
const logFilePath = path.join(__dirname, 'log.txt');
function readVariables() {
try {
const fileContent = fs.readFileSync(filePath, 'utf-8');
@StefanoCecere
StefanoCecere / convert_FB_JSON.py
Last active October 29, 2023 04:57
a Python script that converts Facebook exported posts (in JSON format) and saves them as multiple markdown files
import json
import html
from datetime import datetime
def save_post(filename, date, text):
print('----- NEW POST')
print(filename)
# print(text)
body = f"""---
title:
@akesterson
akesterson / gist:11391984
Created April 29, 2014 06:22
Why I switched from bamboo to jenkins
TL;DR - It was proving to be more buildsystem than I needed,
and I had found that there were other buildsystems that met my needs
that I felt were lighter and more nimble. It's still a fine product
that I continue to recommend to this day, I just no longer see it as
"The One True Way".
=========================
1: Bamboo was consuming a significant amount of system resources,
import sys
import openai
import json
import pandas as pd
from Bio import Entrez
from datetime import datetime
from PyQt6 import QtWidgets, QtGui
from PyQt6.QtCore import Qt
# Replace with your own ChatGPT API key
import sys
import openai
import json
import pandas as pd
from Bio import Entrez
from datetime import datetime
from PyQt6 import QtWidgets, QtGui
from PyQt6.QtCore import Qt
# Replace with your own ChatGPT API key
@sr75
sr75 / wget-jdk-oracle-install-example.txt
Last active March 16, 2023 11:28
wget command to install Oracle JAVA JDK from stupid oracle website for centos and ubuntu
http://d.stavrovski.net/blog/post/how-to-install-and-setup-oracle-java-jdk-in-centos-6
# rpm
wget --no-cookies \
--no-check-certificate \
--header "Cookie: oraclelicense=accept-securebackup-cookie" \
"http://download.oracle.com/otn-pub/java/jdk/7u55-b13/jdk-7u55-linux-x64.rpm" \
-O jdk-7-linux-x64.rpm
# ubuntu
package com.acme.scriptrunner.test
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.IssueInputParametersImpl
import com.atlassian.jira.project.AssigneeTypes
import com.onresolve.jira.groovy.GroovyFunctionPlugin
import com.onresolve.scriptrunner.canned.jira.utils.CustomScriptDelegate
import com.onresolve.scriptrunner.canned.jira.workflow.postfunctions.CustomScriptFunction
import com.onresolve.scriptrunner.test.AbstractWorkflowSpecification
import com.opensymphony.workflow.loader.ActionDescriptor