Skip to content

Instantly share code, notes, and snippets.

@phrawzty
phrawzty / 2serv.py
Last active June 30, 2024 05:39
simple python http server to dump request headers
#!/usr/bin/env python2
import SimpleHTTPServer
import SocketServer
import logging
PORT = 8000
class GetHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
@jmiserez
jmiserez / export_google_music.js
Last active December 20, 2023 01:45
(fixed/updated 2016-05-10) Export your Google Music Library and Playlists (Google Play Music All Access) (see http://webapps.stackexchange.com/questions/50311/print-playlist-from-google-play-music for more)
// Copyright 2016 Jeremie Miserez <jeremie@miserez.org>
//
// MIT License
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF O
@AndrewReitz
AndrewReitz / RxFibN.java
Created June 16, 2014 23:16
RxJava implementation of Fibonacci Number
public class Main {
public static void main(String[] args) {
rxFibN(20).subscribe(new Action1<Integer>() {
@Override public void call(Integer result) {
System.out.println(result);
}
});
}
static Observable<Integer> rxFibN(final int n) {
@stuart-warren
stuart-warren / CreateJob.sh
Last active March 8, 2024 16:20
Create a job in Jenkins (or folder) using the HTTP API
# check if job exists
curl -XGET 'http://jenkins/checkJobName?value=yourJobFolderName' --user user.name:YourAPIToken
# with folder plugin
curl -s -XPOST 'http://jenkins/job/FolderName/createItem?name=yourJobName' --data-binary @config.xml -H "Content-Type:text/xml" --user user.name:YourAPIToken
# without folder plugin
curl -s -XPOST 'http://jenkins/createItem?name=yourJobName' --data-binary @config.xml -H "Content-Type:text/xml" --user user.name:YourAPIToken
# create folder
@justlaputa
justlaputa / jenkins-api.md
Last active May 17, 2024 14:53
Jenkins Json API

jobs

jenkins_url + /api/json?tree=jobs[name,color]

builds

jenkins_url + /job/${job_name}/api/json?tree=builds[number,status,timestamp,id,result]

last build

@ishida
ishida / gist:2719962
Created May 17, 2012 16:21
change alias in keystore using keytool
$ keytool -changealias -keystore MY_KEYSTORE_2.jks -alias XXX-XXX-XXX-XXX-XXX -destalias MY_ALIAS
@nkabir
nkabir / settings.xml
Created March 22, 2012 15:59
Maven Settings xml for Sonar
<profiles>
<profile>
<id>sonar</id>
<properties>
<sonar.jdbc.url>jdbc:mysql://localhost:3306/sonar</sonar.jdbc.url>
<sonar.jdbc.driver>com.mysql.jdbc.Driver</sonar.jdbc.driver>
<sonar.jdbc.username>sonar</sonar.jdbc.username>
<sonar.jdbc.password>xxxxx</sonar.jdbc.password>
<!-- SERVER ON A REMOTE HOST -->
<sonar.host.url>http://localhost:9000</sonar.host.url>
@jessedc
jessedc / compiled.html
Created April 25, 2011 12:19
Jade Example for Steve
<html lang="en">
<head>
<title>
title of the page
</title>
<link rel="stylesheet" type="text/css" href="/stylesheets/style.css">
</head>
<body>
<h1>
title of the post
@albuquerquev
albuquerquev / springjms_wsmq_1.xml
Created March 31, 2011 08:43
Connecting To WebSphere MQ Using Spring JMS And Maven Post - WebSphere MQ Dependencies In Maven (http://goo.gl/KQ2rh)
<dependency>
<groupId>com.ibm</groupId>
<artifactId>com.ibm.mqjms</artifactId>
<version>${webSphereMQVersion}</version>
</dependency>
<dependency>
<groupId>com.ibm</groupId>
<artifactId>com.ibm.mq.jmqi</artifactId>
<version>${webSphereMQVersion}</version>
</dependency>