Skip to content

Instantly share code, notes, and snippets.

@ywjno
ywjno / JSTORsearch.py
Last active August 29, 2015 14:08
JSTOR search
#!/usr/bin/python
import os, sys
metaPath = './PRE_1923_METADATA'
#Returns a list of all metafiles in './PRE_1923_METADATA'
def fileList(path):
files = []
for root, dirs, allFiles in os.walk(path):
@ywjno
ywjno / RemoteSQLite.cs
Last active August 29, 2015 14:08
RemoteSQLite.cs
using System;
using System.Data;
using System.IO;
using System.IO.Compression;
using System.Net;
using System.Net.Sockets;
using System.Runtime.Serialization.Formatters.Binary;
using System.Text;
using System.Threading;
/*
@ywjno
ywjno / truck_location.c
Created September 24, 2014 15:30
coursera_[Computer Programming]_homework2
#include <stdio.h>
#define SPEED 10
// 北:0,东:1,南:2,西:3
int path = 0;
int x = 0;
int y = 0;
int getDistance(int time) {
@ywjno
ywjno / gist:777c1af1f8ef0a38a931
Created August 10, 2014 09:17
'_PC_64' undeclared (first use in this function)
add this code
```c
#ifndef _PC_64
#define _PC_64 0x00000000
#endif
#ifndef _MCW_PC
#define _MCW_PC 0x00030000
#endif
@ywjno
ywjno / build_jar.rb
Created June 17, 2014 04:09
build_jar
# encoding: utf-8
require "json"
require "fileutils"
conf = JSON.load(File.open(File.expand_path("../conf.json", __FILE__), 'r'))
tmp_path = conf['tmp_path'] || File.expand_path("../tmp", __FILE__)
FileUtils.rm_rf(tmp_path) if File.exist?(tmp_path)
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf8">
<title>Float Label Pattern</title>
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
<style type="text/css" media="screen">
.row {
/*position: relative;*/
padding-top: 24px;
@ywjno
ywjno / connection.rb
Last active December 29, 2015 04:09
Net::HTTP Example
# encoding: utf-8
require "net/http"
require "uri"
class Connection
VERB_MAP = {
:get => Net::HTTP::Get,
:post => Net::HTTP::Post,
:put => Net::HTTP::Put,
@ywjno
ywjno / REAME.md
Created October 15, 2013 09:33 — forked from romansklenar/REAME.md

How to set up your VPS with Chef Solo

1. What is it?

There are many different provisioning tools out there, the most popular of which are Chef and Puppet. Chef uses Ruby, Puppet uses a DSL (Domain Specific Language), there are others that use simple bash too, but today we're going to focus on Chef Solo.

2. Dependencies

To get Chef working properly on your local machine you need a few things.

Make sure you use Ruby 1.9.x and not Ruby 2.x as you will get errors with the json 1.6.1 gem on 2.x. Use rbenv or RVM to manage several different Rubies on the one machine.

@ywjno
ywjno / ruby_install.sh
Created October 4, 2013 14:43
install ruby by uesd ruby-install
#!/usr/bin/env bash
wget -O ruby-install-0.3.0.tar.gz https://github.com/postmodern/ruby-install/archive/v0.3.0.tar.gz --no-check-certificate
tar -xzvf ruby-install-0.3.0.tar.gz
cd ruby-install-0.3.0/
sudo make install
sudo ruby-install -i /usr/local/ ruby
gem install chef ruby-shadow librarian-chef --no-ri --no-rdoc
@ywjno
ywjno / gist:5733829
Created June 8, 2013 03:03
mou app manual
# Mou
![Mou icon](http://mouapp.com/Mou_128.png)
## Overview
**Mou**, the missing Markdown editor for *web developers*.
### Syntax