Skip to content

Instantly share code, notes, and snippets.

View gn-spawn's full-sized avatar
🏠
Working from home

spawn gn-spawn

🏠
Working from home
View GitHub Profile
# -*- coding: utf-8 -*-
from fabric.api import run, sudo, cd
from fabric.contrib.files import sed, append, contains
def execute():
update()
rbenv_install()
ruby_and_rails_install()
all_port_open()
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "centos7-updated-20150209"
config.vm.box_url = "https://www.dropbox.com/s/ojfambfh4m40c0t/centos7-updated-20150209.box?dl=1"
config.vm.provision :fabric do |fabric|
fabric.fabfile_path = "./provision.py"
fabric.tasks = ["execute"]
@gn-spawn
gn-spawn / nokogiriTest.rb
Created September 30, 2015 05:27
sample
require 'open-uri'
require 'nokogiri'
URL = 'http://heavens-fox.blog.jp/'
html = open(URL) { |f| f.read }
doc = Nokogiri::HTML.parse(html, nil)
class BabymetalArticle
def initialize(article)
@title = article.css("h1.article-title > a").text
void setup() {
size(512,512);
background(0);
noStroke();
}
int mojim[][][] = {
{{50, 450}, {50, 50}},
{{50, 50}, {250, 200}},
{{250, 200}, {450, 50}},
@gn-spawn
gn-spawn / style.css
Last active October 18, 2016 01:27
for markdown
.highlight {
visibility: hidden;
}
package ex5;
import org.w3c.dom.Document;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.xpath.XPath;
import javax.xml.xpath.XPathConstants;
private ArrayList<String> getTweets(String hashtag, String user_name) {
NodeList nodeList = null;
ArrayList<String> tweets = new ArrayList<String>();
try {
URL url = new URL("https://queryfeed.net/tw?q=%23" + URLEncoder.encode(hashtag, "UTF-8") + "+%40" + user_name + "&title-type=user-name-both&geocode=");
URLConnection urlConnection = url.openConnection();
urlConnection.connect();
InputStream inputStream = urlConnection.getInputStream();
// DOM取得
DocumentViewer documentViewer = new DocumentViewer();
package jp.ac.dendai.im.web;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.bootstrap.DOMImplementationRegistry;
import org.w3c.dom.ls.DOMImplementationLS;
import org.w3c.dom.ls.LSInput;
import org.w3c.dom.ls.LSParser;
import java.io.InputStream;
import java.net.URL;
ArrayList<String> tweets = mashup.getTweets("スポーンメモ", "gn_spawn");
ArrayList<String> diff = new ArrayList<String>(tweets);
diff.removeAll(cache);
cache = tweets;
for (String tw : diff) {
System.out.println(tw + "が追加されました");
}
// Place your settings in this file to overwrite the default settings
{
"files.autoSave": "afterDelay",
"editor.fontSize": 14,
"typescript.check.tscVersion": false,
"editor.tabSize": 2,
"editor.insertSpaces": true,
// HTML, JavaScript, Vue
"files.associations": {
"*.vue" : "vue"