Want to create a Gist from your editor, the command line, or the Services menu? Here's how.
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
| # -*- coding:utf-8 -*- | |
| import json | |
| import sqlite3 | |
| JSON_FILE = "some.json" | |
| DB_FILE = "some.db" | |
| traffic = json.load(open(JSON_FILE)) | |
| conn = sqlite3.connect(DB_FILE) |
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
| import java.io.FileInputStream; | |
| import java.io.FileOutputStream; | |
| import java.io.IOException; | |
| import java.io.InputStream; | |
| import java.util.Iterator; | |
| import org.apache.poi.hssf.usermodel.HSSFCell; | |
| import org.apache.poi.hssf.usermodel.HSSFRow; | |
| import org.apache.poi.hssf.usermodel.HSSFSheet; | |
| import org.apache.poi.hssf.usermodel.HSSFWorkbook; |
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
| #!/bin/sh | |
| # ------------------------------------------------------------------- | |
| # Headless VirtualBox installation script with PhpVirtualBox | |
| # ------------------------------------------------------------------- | |
| # 1. Add VirtualBox source | |
| echo "deb http://download.virtualbox.org/virtualbox/debian precise contrib" > virtualbox.list | |
| sudo mv virtualbox.list /etc/apt/sources.list.d/ | |
| wget -q http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc -O- | sudo apt-key add - |
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
| 2014/09/21 05:21:05 Packer Version: 0.7.1 | |
| 2014/09/21 05:21:05 Packer Target OS/Arch: windows amd64 | |
| 2014/09/21 05:21:05 Built with Go Version: go1.3.1 | |
| 2014/09/21 05:21:05 [DEBUG] Discoverd plugin: amazon-chroot = D:\Software\Development\Packer-0.7.1\packer-builder-amazon-chroot.exe | |
| 2014/09/21 05:21:05 [DEBUG] Discoverd plugin: amazon-ebs = D:\Software\Development\Packer-0.7.1\packer-builder-amazon-ebs.exe | |
| 2014/09/21 05:21:05 [DEBUG] Discoverd plugin: amazon-instance = D:\Software\Development\Packer-0.7.1\packer-builder-amazon-instance.exe | |
| 2014/09/21 05:21:05 [DEBUG] Discoverd plugin: digitalocean = D:\Software\Development\Packer-0.7.1\packer-builder-digitalocean.exe | |
| 2014/09/21 05:21:05 [DEBUG] Discoverd plugin: docker = D:\Software\Development\Packer-0.7.1\packer-builder-docker.exe | |
| 2014/09/21 05:21:05 [DEBUG] Discoverd plugin: googlecompute = D:\Software\Development\Packer-0.7.1\packer-builder-googlecompute.exe | |
| 2014/09/21 05:21:05 [DEBUG] Discoverd plugin: null = D:\Software\Development\Packer-0.7.1\packer-b |
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 'open-uri' | |
| require 'json' | |
| print 'Github Username: ' | |
| username = gets.chomp | |
| # get gists | |
| puts 'Downloading gists list' | |
| gists_str = open("https://api.github.com/users/#{username}/gists").read |
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
| sudo apt-get update -y | |
| sudo apt-get install git -y | |
| git clone https://github.com/apache/storm.git | |
| wget http://ftp.unicamp.br/pub/apache/storm/apache-storm-0.9.5/apache-storm-0.9.5.tar.gz | |
| tar -zxvf apache-storm-0.9.5.tar.gz | |
| wget http://mirror.nbtelecom.com.br/apache/zookeeper/zookeeper-3.4.6/zookeeper-3.4.6.tar.gz | |
| tar -zxvf zookeeper-3.4.6.tar.gz | |
| touch zookeeper-3.4.6/conf/zoo.cfg |
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
| <?php | |
| /* | |
| * simple HttpRequest example using PHP | |
| * tom slankard | |
| */ | |
| class HttpRequest { | |
| public $url = null; |
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
| /* | |
| Copyright 2011 Martin Hawksey | |
| Licensed under the Apache License, Version 2.0 (the "License"); | |
| you may not use this file except in compliance with the License. | |
| You may obtain a copy of the License at | |
| http://www.apache.org/licenses/LICENSE-2.0 | |
| Unless required by applicable law or agreed to in writing, software |