Skip to content

Instantly share code, notes, and snippets.

View serkanserttop's full-sized avatar

Serkan serkanserttop

  • İstanbul, Turkey
View GitHub Profile
@serkanserttop
serkanserttop / wcDocker.js
Created March 28, 2017 04:44
wcDocker demo
This file has been truncated, but you can view the full file.
(function () {/**
* @license almond 0.3.1 Copyright (c) 2011-2014, The Dojo Foundation All Rights Reserved.
* Available via the MIT or new BSD license.
* see: http://github.com/jrburke/almond for details
*/
//Going sloppy to avoid 'use strict' string cost, but strict practices should
//be followed.
/*jslint sloppy: true */
/*global setTimeout: false */
(function($){var lm={"config":{},"container":{},"controls":{},"errors":{},"items":{},"utils":{}};
lm.utils.F = function () {};
lm.utils.extend = function( subClass, superClass ) {
subClass.prototype = lm.utils.createObject( superClass.prototype );
subClass.prototype.contructor = subClass;
};
lm.utils.createObject = function( prototype ) {
@serkanserttop
serkanserttop / Dockerfile
Created January 4, 2016 09:55
SMF Test Dockerfile
# docker build --no-cache=true -t serkanserttop/smf-exposed .
# docker run -p 8080:8080 -it -v $(pwd):/home/ubuntu serkanserttop/smf-exposed
FROM cloud9/workspace
MAINTAINER Serkan Serttop <serkanserttop@smartface.io>
RUN echo "Version 0.1"
#check if Java 1.7 is installed, if not, then install
RUN if [ $(dpkg-query -W -f='${Status}' openjdk-7-jdk 2>/dev/null | grep -c "ok installed") -eq 0 ]; \
@serkanserttop
serkanserttop / flick.json
Created December 17, 2015 14:15
Flickr API json
{"query":{"count":10,"created":"2015-12-17T14:13:03Z","lang":"en-US","results":{"photo":[{"farm":"1","id":"23683631342","isfamily":"0","isfriend":"0","ispublic":"1","owner":"39638504@N07","secret":"12b9d7b4ea","server":"714","title":"little big friends"},{"farm":"6","id":"23429418529","isfamily":"0","isfriend":"0","ispublic":"1","owner":"26144115@N06","secret":"4e8ac45992","server":"5780","title":"Land of Legends"},{"farm":"6","id":"23155376903","isfamily":"0","isfriend":"0","ispublic":"1","owner":"126105876@N03","secret":"66f3d9a9a6","server":"5689","title":"enter the twilight zone [explored]"},{"farm":"1","id":"23681061992","isfamily":"0","isfriend":"0","ispublic":"1","owner":"97236284@N04","secret":"8bd2972404","server":"705","title":"White Phalaenopsis Orchids"},{"farm":"6","id":"23160413954","isfamily":"0","isfriend":"0","ispublic":"1","owner":"38954353@N06","secret":"f1ff2eb94d","server":"5644","title":"Hot air"},{"farm":"1","id":"23482855800","isfamily":"0","isfriend":"0","ispublic":"1","owner":"800361
alert("Hello World");
@serkanserttop
serkanserttop / WebView_example.js
Created March 2, 2015 11:41
basic example for SMF.UI.WebView usage
/*globals SMF, Pages*/
(function(){
Pages.pageWithButton = new SMF.UI.Page();
Pages.pageWithWebView = new SMF.UI.Page();
var btn = new SMF.UI.TextButton({
text: 'Go To WebView',
onPressed: function(e){
Pages.pageWithWebView.show();
@serkanserttop
serkanserttop / datasource-tasks-results
Last active July 15, 2017 23:24
Loopback Model Discovery, bug?
//DataSource.prototype.discoverSchemas
//async.parallel(tasks, function (err, results) {
// console.log(results);
//https://github.com/strongloop/loopback-datasource-juggler/blob/master/lib/datasource.js#L1205
[
[
{ owner: 'chosendb',
tableName: 'chosentable',
columnName: 'id'
},
@serkanserttop
serkanserttop / inserted.json
Created September 8, 2014 17:58
Insert the original.json file into a running MongoDB instance. I am using localhost:27017 for this example. That document is fetched and re-inserted after its _id is changed. I was hoping it would preserve fields with null values but it does not.
{
"_id" : "456321",
"user" : {
"id" : 654321
}
}
@serkanserttop
serkanserttop / m202-batch-vid-linkify.js
Created April 29, 2014 22:28
Turns text hrefs into actual links and appends as a new list - m202
var hrefs = $('.main-article > .wiki-article > pre > code').text().split('\n'), links = [], i = 0;
for(i; i < hrefs.length; i++){
links.push('<a href="' + hrefs[i] + '">' + hrefs[i] + '</a>');
}
$('.main-article > .wiki-article').append(links.join('<br>'));