Skip to content

Instantly share code, notes, and snippets.

randomInRange = function(min, max) {
var random = Math.floor(Math.random() * (max - min + 1)) + min;
return random;
}
randomFromCollection = function(C) {
return function() {
c = C.find().fetch();
i = randomInRange(0, c.length); //c.count() is not valid in meteor 1.0.2.1 since this is an array now.
@suhaboncukcu
suhaboncukcu / contentTemplate.html
Last active August 29, 2015 14:14
meteor-dropzone problem
<template name="contentTemplate">
<div class="pusher">
<div class="ui basic segment">
{{#if homeSession}}
{{> home}}
{{/if}}
@suhaboncukcu
suhaboncukcu / installphp7.sh
Last active November 23, 2015 19:42 — forked from tronsha/installphp7.sh
Install PHP7 to Ubuntu
#!/bin/bash
apt-get update
apt-get install -y git-core autoconf bison libxml2-dev libbz2-dev libmcrypt-dev libcurl4-openssl-dev libltdl-dev libpng-dev libpspell-dev libreadline-dev pkg-config libssl-dev
mkdir -p /etc/php7/conf.d
mkdir -p /etc/php7/cli/conf.d
mkdir /usr/local/php7
cd /tmp
git clone https://github.com/php/php-src.git --depth=1
cd php-src
./buildconf
@suhaboncukcu
suhaboncukcu / domain.ssl.conf
Created April 14, 2017 10:55
Nginx SSL Certificate Basic Installation.
# this is usually under cd /etc/nginx-sp/vhosts.d
# file paths are for serverpilot.io but the settings should be the same for every nginx.
# certificate_file.crt is usually a chain bundle that you can create with a simple cat.
# thanks to regan: https://www.digitalocean.com/community/questions/install-ssl-certificate-manually-on-serverpilot-2?answer=23780
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name
www.DOMAIN.com
@suhaboncukcu
suhaboncukcu / custom.sass
Last active November 29, 2020 17:47
Bulma Gulp Minimal Setup
@import "../node_modules/bulma/sass/utilities/initial-variables"
// custom overrides and general styles
@import "./general/style.sass"
@import "./mymodule/style.sass"
//
@import "../node_modules/bulma/bulma"
@suhaboncukcu
suhaboncukcu / .htaccess
Created October 10, 2017 15:04
serverpilotNodeAppSettings
RewriteRule index.html http://localhost:2368/ [P]
RewriteRule (.*) http://localhost:2368/$1 [P]
@suhaboncukcu
suhaboncukcu / bash
Created June 30, 2018 12:46
docker-compose installation for mac
brew install jq;
LATEST_VERSION=$(curl -s https://api.github.com/repos/docker/compose/releases/latest | jq -r '.tag_name');
curl -L "https://github.com/docker/compose/releases/download/$LATEST_VERSION/docker-compose-$(uname -s)-$(uname -m)" > /usr/local/bin/docker-compose;
chmod +x /usr/local/bin/docker-compose;