Skip to content

Instantly share code, notes, and snippets.

@Bostonncity
Bostonncity / gist:7d67d0fb55e619b2ce31
Created December 23, 2015 06:33 — forked from schacon/gist:1
the meaning of gist
This is gist.
There are many like it, but this one is mine.
It is my life.
I must master it as I must master my life.
Without me gist is useless.
Without gist, I am useless.
@Bostonncity
Bostonncity / sublime_setup.md
Created December 20, 2015 08:47 — forked from barnes7td/sublime_setup.md
Sublime Terminal Setup

Setup Terminal for Sublime Shorcut "subl":

Open terminal and type:

1. Create a directory at ~/bin:

mkdir ~/bin

2. Copy sublime executable to your ~/bin directory:

// 詳しい解説は下記
// https://trifort.jp/blog/development/%E6%8E%A2%E6%A4%9C%EF%BC%81swiftyjson-%E5%89%8D%E7%B7%A8/
struct SampleStruct {
var object:Any?
}
// ここに実装を追加していきます
// [] を実装
extension SampleStruct {
@Bostonncity
Bostonncity / api.json
Created December 20, 2015 08:19 — forked from jacobtyq/api.json
A JSON formatted response containing all posts from a Jekyll blog
[
{
"homepage": "http://digitaljhelms.github.com",
"name": "digitaljhelms",
"description": "finally blogging...",
"author": "Jeremy Helms",
"post": {
"url": "http://digitaljhelms.github.com/howto/creating-a-branch-with-no-parents-or-history",
"slug": "creating-a-branch-with-no-parents-or-history",
"title": "Create a Git Branch without Parents or History",
@Bostonncity
Bostonncity / index.js
Created December 20, 2015 08:17 — forked from franzwong/index.js
Get docker container ip and port
// sudo docker run -it --rm -p 3000 -v /var/run/docker.sock:/var/run/docker.sock rwwa/test_service
var http = require('http');
var hostname = process.env['HOSTNAME'];
console.log('hostname: ' + hostname);
function getContainerInfo() {
var options = {
socketPath: '/var/run/docker.sock',
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <map>
#include <string>
#include <cstring>
//#include <unordered_map>
#include <queue>
#include <algorithm>
let Chord = (T, noteNumbers) => {
return T(noteNumbers.map((noteNumber) => {
frequency: T("mtof", { value: noteNumber }),
})).T("XLine.ar", { duration: 2, doneAction: 2 });
};
let cmaj = timbre(Chord, [ 60, 64, 69 ]);
cmaj.start(timbre.currentTime).on("ended", () => {
console.log("END!!");
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header/>
<soapenv:Body>
<cdis:ValidateOrderList xmlns:cdis="http://www.cdiscount.com">
<cdis:headerMessage xmlns:h="http://schemas.datacontract.org/2004/07/Cdiscount.Framework.Core.Communication.Messages">
<h:Context>
<h:CatalogID>
1
</h:CatalogID>
@Bostonncity
Bostonncity / installer.sh
Created December 20, 2015 08:11 — forked from panbanda/installer.sh
Install Screaming Frog in the Amazon AWS Cloud
# Setting up Ubuntu
sudo apt-get update
sudo apt-get -y install xfce4 xfce4-goodies openjdk-7-jdk vnc4server
# Setup the login and configs
vncserver
vncserver -kill: 1
# Uncommenting settings required for normal vnc startup
sudo sed -i.bak s/"# exec"/"exec sh"/g ~/.vnc/xstartup
@Bostonncity
Bostonncity / forwardport.sh
Created December 20, 2015 08:09 — forked from wizact/forwardport.sh
Forward port 80 to 8080 on EC2 instance.
sudo iptables -t nat -L
sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 8000