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 Foundation | |
var data: NSData = NSData.init(bytes: "Hello, World!", length: 13) | |
withUnsafePointer(to: data) { | |
print("value \(String(describing: data)) has address: \($0)") | |
} | |
var cfData: CFData = data | |
withUnsafePointer(to: cfData) { |
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
package jp.example.android.util.html | |
import android.content.Context | |
import android.graphics.Bitmap | |
import android.support.v4.content.ContextCompat | |
import android.text.SpannableString | |
import android.text.SpannableStringBuilder | |
import android.text.Spanned.SPAN_INCLUSIVE_INCLUSIVE | |
import android.text.style.TextAppearanceSpan | |
import android.view.Gravity.CENTER |
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
{ | |
"lunch_id": int, | |
"separateSize": int, | |
"members": [ | |
{ | |
"user_id": int, | |
"user_name": string, | |
"user_sex": boolean | |
"user_expense_times": int | |
"user_select_shop_times": int |
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
{ | |
"sort-order": [ | |
"align-content", | |
"align-items", | |
"align-self", | |
"-o-animation", | |
"-ms-animation", | |
"-moz-animation", | |
"-webkit-animation", | |
"animation", |
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
var gulp = require('gulp'); | |
var fs = require('fs'); | |
var postcss = require('gulp-postcss'); | |
var scss = require('postcss-scss'); | |
var styleguide = require('postcss-style-guide'); | |
gulp.task('default', function () { | |
var processors = [ | |
styleguide |
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
# Install | |
sudo touch /etc/yum.repos.d/nginx.repo | |
sudo sh -c "cat << 'EOF' > /etc/yum.repos.d/nginx.repo | |
[nginx] | |
name=nginx repo | |
baseurl=http://nginx.org/packages/OS/OSRELEASE/$basearch/ | |
gpgcheck=0 | |
enabled=1 | |
EOF" | |
sudo yum update -y |
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
# クライアントからは以下のようにして接続 | |
# nats://user:password@localhost:4242 | |
port: 4242 | |
authorization { | |
user: user | |
password: password | |
} | |
# クラスタの設定 | |
cluster { |
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
<!DOCTYPE html> | |
<html lang="ja"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>sample html</title> | |
</head> | |
<body> | |
<form id="hoge"> | |
<fieldset> | |
<legend>test form</legend> |
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
https = require 'https' | |
async = require 'async' | |
global = { | |
url: 'https://api.amebaowndme.com/v2/public/blogPosts?limit=200&page=&siteId=11014&sortType=recent' | |
} | |
requestURL = (callback) => | |
req = https.get global.url, (res) -> | |
@res = "" |
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
var mongoose = require("mongoose"); | |
var DBName = ""; | |
M.prototype.connection = mongoose.createConnection("mongodb://127.0.0.1/" + DBName, callback); | |
var database = M.connection.db | |
var collection = database.collection("datas"); | |
// keys (object), condition (object), initial (object), reduce (function), finalize (function), [options] (object), callback | |
collection.group({"id":true}, null, {}, function (curr, result) { | |
result._id = curr._id; |
NewerOlder