Skip to content

Instantly share code, notes, and snippets.

@dsager
dsager / idea-backup.sh
Last active April 25, 2017 13:30
Shell Script to backup IntelliJ IDEA project settings
#! /bin/bash
BAKDIR="${HOME}/Dropbox/config-backup/intellij/project-settings"
BAKFILE="${BAKDIR}/idea-folders.txt"
#create backup folder
mkdir -p "${BAKDIR}"
# find all `.idea` folders in home
if [ ! -e "${BAKFILE}" ]; then
@geowarin
geowarin / gulpfile.js
Last active December 10, 2015 21:26
gulpfile.js
var gulp = require('gulp');
var downloadelectron = require('gulp-download-electron');
var shell = require('gulp-shell');
var packageJson = require('./package.json');
var electron = require('gulp-electron');
gulp.task('package', function() {
gulp.src("")
.pipe(electron({
src: '.',
@geowarin
geowarin / gh-create-repo.fish
Created May 9, 2015 00:12
Publish the current repository to github with fish shell and httpie
function gh-create-repo
if not is_installed http
echo "Please install httpie"
return 1
end
set -l username (git config --global user.name)
echo -n "Enter password for $username : "
stty -echo
@jonobr1
jonobr1 / auto-capture.scpt
Last active September 6, 2024 19:20
A small AppleScript to take a screenshot every 30 seconds for 8 hours. Saves to an Image Sequence in a desktop folder. Great for recording your workday.
set dFolder to "~/Desktop/screencapture/"
do shell script ("mkdir -p " & dFolder)
set i to 0
repeat 960 times
do shell script ("screencapture " & dFolder & "frame-" & i & ".png")
delay 30 -- Wait for 30 seconds.
set i to i + 1
end repeat
@nwertzberger
nwertzberger / gist:f564cefe0d9eb88494d6
Last active August 29, 2015 14:19
appassembler plugin configuration
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>appassembler-maven-plugin</artifactId>
<version>1.9</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>generate-daemons</goal>
(*
Here is a copy-able shell text:
osascript /[SCRIPT LOCATION]/countdown.scpt "[output parameter]" "MM/DD/YYYY HH:MM:SS AM"
*)
on run argv
-- Lists for Parameters
set ParamList to {"Days", "Minute", "MinuteW", "Second", "SecondW"}
set ParamList2 to {"Minute", "MinuteW", "Second", "SecondW"}
set ParamList3 to {"Second", "Secondw"}
@acdvorak
acdvorak / tmux-all-panes.sh
Last active August 6, 2021 17:09 — forked from yubink/inall.sh
tmux: run a command in all panes
#!/bin/bash
# Runs the specified command (provided by the first argument) in all tmux panes
# in every window. If an application is currently running in a given pane
# (e.g., vim), it is suspended and then resumed so the command can be run.
all-panes()
{
all-panes-bg_ "$1" &
}
@dkandalov
dkandalov / jira.groovy
Last active October 7, 2022 03:56
Tiny example of using JIRA rest API from groovy
/**
* You might need to import JIRA ssl certificate into your jdk/jre cacerts file:
* 1) save JIRA certificate. E.g. in Chrome right click on https icon, click "Certificate information" link.
* In "Details" tab, click "Copy to File..." button.
* 2) in jdk "bin" folder run: "keytool -importcert -keystore ./cacerts -file /file/from/the/step/above/cacert.crt -trustcacerts -alias jira_ca
*/
class JiraMain {
static void main(String[] args) {
// see https://docs.atlassian.com/jira/REST/latest/
def listWatchers = "https://jira/rest/api/2/issue/PROJ-123/watchers"
@sadikovi
sadikovi / LoginSimulation.scala
Created February 25, 2015 09:26
Another example of Gatling scenario with complex authentication/response processing and number of simple requests that have been used as a test.
package mobilepackage
import io.gatling.core.Predef._
import io.gatling.core.session._
import io.gatling.http.Predef._
import scala.concurrent.duration._
import scala.util.parsing.json._
import general._
class LoginSimulation extends Simulation {
@jeffdonthemic
jeffdonthemic / index.js
Last active October 27, 2023 15:42
Lambda function to commit code to github. See blog post for more details.
var githubapi = require("github"),
async = require("async"),
AWS = require('aws-sdk'),
secrets = require('./secrets.js');
// the 'handler' that lambda calls to execute our code
exports.handler = function(event, context) {
// config the sdk with our credentials
// http://docs.aws.amazon.com/AWSJavaScriptSDK/guide/node-configuring.html