Skip to content

Instantly share code, notes, and snippets.

<?php
namespace Foo;
use Foo\ClassB;
class ClassA
{
}
@michael34435
michael34435 / install.sh
Created March 6, 2016 13:09
phalcon in php7 install script(tested by centos 7)
rpm -Uvh http://download.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
rpm -Uvh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
yum-config-manager --enable remi
yum-config-manager --enable remi-php70
yum update
yum install -y make gcc re2c file git
yum install -y --enablerepo=remi-php70 --skip-broken php php-devel php-common php-pdo php-mbstring php-xml
yum remove -y php-pecl-igbinary
yum remove -y php-pecl-memcache
<!DOCTYPE html>
<html id="play">
<head>
<title>Bling Bling</title>
<link rel="stylesheet" type="text/css" href="style.css">
<link rel="stylesheet" href="font-awesome/css/font-awesome.min.css">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
var m = require('mraa'); //IO Library
var express = require('express')
var app = express();
var exec = require('sync-exec');
app.use(express.static('static'));
var blinkInterval = 1000; //set default blink interval to 1000 milliseconds (1 second)
var blinkStatus = false;
var ledState = 1; //set default LED state
var point_Alpha = 0 ;
function playGame() {
var left = $('.k-left .value>span').eq(0).text();
var right = $('.k-right .value>span').eq(0).text();
right = right.replace('−', '-');
left = left.replace('−', '-');
var resultLeft = eval(left.trim());
var resultRight = eval(right.trim());
console.log(resultLeft, resultRight);
if (resultLeft > resultRight) {
Game.answer(1);
# coding: utf-8
# 自分の得意な言語で
# Let's チャレンジ!!
N = input()
if N >= 1 and N <= 1000000:
data = 1
for i in range(1, N + 1):
data *= i
print str(data).rstrip('0')[::-1][0:9:][::-1].lstrip('0')
@michael34435
michael34435 / README.md
Last active October 17, 2015 17:52
給以後要安裝pep linter的時候的筆記

給在MACOS時會遇到的解法

pep8

sudo -H pip install pep8  
sudo -H pip install autopep8  

flake8

sudo -H pip install flake8

@michael34435
michael34435 / upload.py
Last active August 29, 2015 14:26
a tool to upload to remote with tar and ssh
#!/usr/local/bin/python
# coding=utf-8
# Copyright (c) 2015 CapsLock, Studio All Rights Reserved.
import os
import sys
import uuid
def main():
argument = ['--help', '-t', '-i', '-h', '-o']
@michael34435
michael34435 / app.py
Last active August 29, 2015 14:23
download file from dmhy to your local system via put.io
#!/usr/bin/python
# -*- coding: utf-8 -*-
import os, requests, json, re, sys, codecs
from path import path
from pyquery import PyQuery as pq
sys.stdout = codecs.getwriter('utf8')(sys.stdout)
sys.stderr = codecs.getwriter('utf8')(sys.stderr)
__TOKEN__ = '{HERE_IS_YOUR_TOKEN}'
@michael34435
michael34435 / services.php
Created April 4, 2015 03:22
camelize your action name in phalcon
<?php
use Phalcon\Text;
use Phalcon\Mvc\Router;
use Phalcon\Mvc\Dispatcher as MvcDispatcher;
use Phalcon\Events\Manager as EventsManager;
$di->set('dispatcher', function() {
$eventsManager = new EventsManager();