Skip to content

Instantly share code, notes, and snippets.

View mmmpa's full-sized avatar
👷‍♂️
working

mmmpa mmmpa

👷‍♂️
working
View GitHub Profile
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/
// author: Pawel Kozlowski
var myApp = angular.module('myApp', []);
//service style, probably the simplest one
myApp.service('helloWorldFromService', function() {
this.sayHello = function() {
return "Hello, World!"
@mmmpa
mmmpa / api.md
Created April 15, 2014 08:06 — forked from koba04/api.md

API

Class: Vue

  • Vueはvue.jsのコアとなるコンストラクタ
  • インスタンスが作られたときにデータバインディングが開始される
  • オプションを取ることも出来て、DOMやデータやメソッドについて定義出来る
class Drager {
public start_x: number = 0;
public start_y: number = 0;
public move_total_x: number = 0;
public move_total_y: number = 0;
public move_x: number = 0;
public move_y: number = 0;
var fs = require('fs');
module.exports = function (grunt) {
grunt.registerTask('listTsReference', 'listing .ts', function () {
var def = grunt.config('listTsReference').def;
var starter = grunt.config('listTsReference').src;
var dest = grunt.config('listTsReference').dest;
var ts = def.concat(read('./'));
var ref = ts.map(function (path, i, self) {
server {
listen 80;
server_name ore-omae.com;
large_client_header_buffers 4 8k;
location ~ .*\.(jpg|JPG|gif|GIF|png|PNG|swf|SWF|css|CSS|js|JS|inc|INC|ico|ICO) {
root /www;
index index.html;
break;
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
source ~/.bashrc
(function(){
var src = document.getElementById('SRC');
var tag = '<div style="display:inline-block;padding:10px;background:#color;width:140px;text-align:center;border:1px solid #000;margin:0 -1px -1px 0;">#color</div>'
var tags = '';
var exist = {};
src.innerHTML.match(/"[0-9a-f]{6}"/ig).sort().forEach(function(color, i, array){
var color = color.replace(/"/ig, '');
if(exist[color]){
return;
}
namespace :twitter do
task :tweet, ['message'] do |t, args|
require 'twitter'
YOUR_CONSUMER_KEY = ''
YOUR_CONSUMER_SECRET = ''
YOUR_OAUTH_TOKEN = ''
YOUR_OAUTH_TOKEN_SECRET = ''
client = Twitter::REST::Client.new do |config|
class ActiveRecord::Base
mattr_accessor :shared_connection
@@shared_connection = nil
def self.connection
@@shared_connection || retrieve_connection
end
end
ActiveRecord::Base.shared_connection = ActiveRecord::Base.connection