Look at LSB init scripts for more information.
Copy to /etc/init.d
:
# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
module.exports = { | |
up: function (queryInterface, Sequelize) { | |
return [ | |
queryInterface.addColumn('User', 'name', { | |
type: Sequelize.STRING | |
}), | |
queryInterface.addColumn('User', 'nickname', { | |
type: Sequelize.STRING, | |
}) | |
]; |
<?php | |
//Detect devices | |
$iPod = stripos($_SERVER['HTTP_USER_AGENT'],"iPod"); | |
$iPhone = stripos($_SERVER['HTTP_USER_AGENT'],"iPhone"); | |
$iPad = stripos($_SERVER['HTTP_USER_AGENT'],"iPad"); | |
$Android = stripos($_SERVER['HTTP_USER_AGENT'],"Android"); | |
if ( $Android ) | |
echo 'Android'; | |
else if ( $iPod || $iPhone || $iPad ) |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<title>React strict mode test</title> | |
</head> | |
<body> | |
<div id="app"></div> |
const createId = (text = Date.now().toString().substring(0, 10)) => { | |
const m = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"]; // 0 ~ 9 | |
let hash = ""; | |
for (let i = 0; i < text.length; i++) { | |
if (i > 6) { | |
hash += text[i]; | |
} else { | |
hash += m[Number(text[i])]; | |
} |
var aws = require('aws-sdk'); | |
var BUCKET = 'node-sdk-sample-7271'; | |
aws.config.loadFromPath(require('path').join(__dirname, './aws-config.json')); | |
var s3 = new aws.S3(); | |
var params = { | |
Bucket: 'node-sdk-sample-7271', | |
Delete: { // required | |
Objects: [ // required | |
{ |
#!/bin/bash | |
# Functions ============================================== | |
# return 1 if global command line program installed, else 0 | |
# example | |
# echo "node: $(program_is_installed node)" | |
function program_is_installed { | |
# set to 1 initially | |
local return_=1 |
// set timezone | |
process.env.TZ = 'Asia/Seoul'; | |
// winston object | |
var winston = require('winston'); | |
var logger = new (winston.Logger)({ | |
transports: [ | |
new (winston.transports.File)({ | |
filename: 'error.log', | |
json: false, |
Look at LSB init scripts for more information.
Copy to /etc/init.d
:
# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
'use strict'; | |
angular.module('myApp') | |
.controller('FaqCtrl', function ($scope, $location, $anchorScroll) { | |
$scope.scrollTo = function(id) { | |
$location.hash(id); | |
$anchorScroll(); | |
} | |
}); |
<!-- Pagination Links --> | |
{% if paginator.total_pages > 1 %} | |
<div class="pagination"> | |
{% if paginator.previous_page %} | |
<a href="{{ paginator.previous_page_path | prepend: site.baseurl | replace: '//', '/' }}">« Prev</a> | |
{% else %} | |
<span>« Prev</span> | |
{% endif %} | |
{% for page in (1..paginator.total_pages) %} |