This file contains hidden or 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
| #!/usr/bin/env ruby | |
| # Just call this without arguments. It will show a friendly help text. | |
| # For xterm-256color, it will even use colors for some commands! | |
| class AppConfig | |
| @@default_remote = 'vpn.example.com' | |
| @@default_networks = '10.0.0.0/24>192.168.1.0/24' | |
| @@default_subject = '/C=US/ST=CA/L=San Francisco/O=Example/OU=/CN={{name}}' |
This file contains hidden or 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
| #!/usr/bin/env ruby | |
| #/ Usage: <progname> [options]... | |
| #/ How does this script make my life easier? | |
| # ** Tip: use #/ lines to define the --help usage message. | |
| $stderr.sync = true | |
| require 'optparse' | |
| # default options | |
| flag = false | |
| option = "default value" |
This file contains hidden or 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
| #!/usr/bin/env ruby | |
| require 'rubygems' | |
| require 'sinatra' | |
| require 'haml' | |
| $pwd = ENV['PWD'] | |
| if File.exists?(ARGV.last) | |
| if ARGV.last != 'bfile.rb' |
This file contains hidden or 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
| RSpec.configure do |config| | |
| config.before(:suite) do | |
| DatabaseCleaner.clean_with(:truncation) | |
| end | |
| config.before(:each) do | |
| DatabaseCleaner.strategy = :transaction | |
| end | |
| config.before(:each, js: true) do |
This file contains hidden or 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
| <div contenteditable="true" class="editable" data-editable-input-id="input-name"></div> | |
| <input id="input-name" type="text" name="input-name" value="" placeholder="Don't Touch Me" /> |
This file contains hidden or 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
| $(document).ready(function() { | |
| // Loop through each of the empty .editable elements and add filler edit text. | |
| $('.editable:empty').each(function(){ | |
| $(this).text('Edit Me'); | |
| }); | |
| // On .editable blur() - when a user clicks off of an .editable element take it's text and pass it to the corresponding input. | |
| $('.editable').blur(function() { | |
| var editableContent = $(this).text(); |
This file contains hidden or 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 ( | |
| "fmt" | |
| "io/ioutil" | |
| "net/http" | |
| "github.com/codegangsta/negroni" | |
| jwt "github.com/dgrijalva/jwt-go" | |
| "github.com/gorilla/mux" |
This file contains hidden or 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
| apt-get update | |
| apt-get install -y git npm | |
| npm install -g n | |
| n stable |
This file contains hidden or 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
| 'use strict'; | |
| var numCpus = require('os').cpus().length | |
| var cluster = require('cluster') | |
| cluster.setupMaster({exec: __dirname + '/server.js'}) | |
| // workerIds returns the node cluster index for each worker | |
| function workerIds() { return Object.keys(cluster.workers) } | |
| // Gets the count of active workers |
This file contains hidden or 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 mypackage.web | |
| import akka.actor._ | |
| import akka.io.IO | |
| import akka.pattern.{AskTimeoutException, ask, gracefulStop, pipe} | |
| import com.typesafe.scalalogging.slf4j.Logger | |
| import javax.inject.Inject | |
| import org.slf4j.LoggerFactory | |
| import scala.concurrent.duration._ | |
| import scala.concurrent.{Await, Future} |
NewerOlder