This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# inspired by http://askubuntu.com/a/528171 and the comments below | |
# build bash 3.2, though this should work for other versions as well | |
BASH_MAJOR=3 | |
BASH_MINOR=2 | |
# prerequisites | |
sudo apt-get install build-essential gettext bison | |
# get bash source |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript: function analyticsURL(){ var properties = { profileID: 'EDIT__YOUR_ANALYTICS_REPORT_ID', daysToShow: EDIT__NUMBER_OF_DAYS_TO_SHOW,includeToday: EDIT__INCLUDE_TODAY_TRUE_OR_FALSE, report_url: 'EDIT__URL_OF_REPORT_YOU_WANT_TO_SHOW' }; function stringify(date){ return date.getFullYear().toString() + pad(date.getMonth() + 1) + pad(date.getDate()); }; function pad(numeral){ return numeral<10 ? '0' + numeral.toString() : numeral.toString(); }; void(properties.report_url = properties.report_url.replace(/([^/])$/, '$1/')); var endDate = new Date(); var startDate = new Date(); properties.includeToday ? false : endDate.setDate( endDate.getDate()-1 ); startDate.setDate( endDate.getDate() - properties.daysToShow + 1 ); return properties.report_url + properties.profileID + '/%3F_.date00%3D' + stringify(startDate) + '%26_.date01%3D' + stringify(endDate) + '/'; }; window.location = analyticsURL(); | |
// INSTRUCTIONS | |
// 1. In the URL above, change the following four variables at the s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# redis - this script starts and stops the redis-server daemon | |
# | |
# chkconfig: - 85 15 | |
# description: Redis is a persistent key-value database | |
# processname: redis-server | |
# config: /etc/redis/redis.conf | |
# config: /etc/sysconfig/redis | |
# pidfile: /var/run/redis/redis.pid |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Service script for running a bundled Meteor application under Forever. | |
# Meteor settings JSON file should be in /etc/meteor/[YOUR APP NAME].json, | |
# and the METEOR_SETTINGS var below should be updated as appropriate. | |
# | |
# chkconfig: 345 80 20 | |
# description: My node app | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
import QuartzCore | |
class ViewController: UIViewController { | |
@IBOutlet weak var label: UILabel | |
@IBOutlet weak var counter: UILabel | |
override func viewDidLoad() { | |
super.viewDidLoad() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// not the most elgant way but it works | |
// in the console post the function below and call changeSwagger("http","localhost:5050","/my_path/) | |
function changeSwagger (scheme,host,path) { | |
var newspec = ui.spec().toJSON().resolved | |
newspec.scheme = [scheme] || newspec.scheme | |
newspec.host = host || newspec.host | |
newspec.basePath = path || newspec.basePath | |
ui.getStore().dispatch({type:'set_scheme',payload: {scheme: newspec.scheme[0]}}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% assign all_hosts = "" | split: "" %} | |
{% for host in site.data.shared_hosts %} | |
{% assign all_hosts = all_hosts | push: host %} | |
{% endfor %} | |
{% for host in site.data.paas_hosts %} | |
{% assign all_hosts = all_hosts | push: host %} | |
{% endfor %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"log" | |
"net" | |
) | |
func main() { | |
var status string | |
conn, err := net.Dial("tcp", "127.0.0.1:80") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
import QuartzCore | |
class ViewController: UIViewController { | |
@IBOutlet weak var label: UILabel | |
@IBOutlet weak var counter: UILabel | |
override func viewDidLoad() { | |
super.viewDidLoad() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM golang:alpine | |
RUN apk update && apk upgrade && \ | |
apk add --no-cache git zip | |
ARG TERRAFORM_VERSION | |
RUN git clone --single-branch --branch v${TERRAFORM_VERSION} https://github.com/hashicorp/terraform.git /go/src/github.com/hashicorp/terraform | |
RUN cd $GOPATH/src/github.com/hashicorp/terraform && echo $GOPATH && go install ./tools/terraform-bundle |
OlderNewer