Skip to content

Instantly share code, notes, and snippets.

View puskuruk's full-sized avatar
🕶️

Tamay Eser Uysal puskuruk

🕶️
View GitHub Profile
const times = howManyTimes => functionWillExecute => {
if (howManyTimes > 0) {
functionWillExecute()
times(howManyTimes - 1)(functionWillExecute)
}
}
const arrayWithDuplicatedItems = [['Mike'], 43, {"genre": "metal", "album": "madness of many"}, null, {"genre": "metal", "band": "animals as leaders"},{c: 'Nancy'}, null, {"genre": "metal", "album": "madness of many"}, 'Adam', 'Jenny', 21, 'Jenny', ['Mike'], 54, {c: 'Nancy'}, 'Carl', 43]
const sortByProperty = (object, property)=>{
return object.sort((first,second) => first[`${property}`] - second[`${property}`])
}
const returnDuplicatedOnes = (elementObjectsArray) =>{
const sortedElementObjectsArray = sortByProperty(elementObjectsArray, 'rank');
const duplicatedOnes = [];
const arrayWithDuplicatedItems = [['Mike'], {"c": 'Nancy'}, 43, {"c": 'Nancy'}, 'Adam', 'Jenny', 21, 'Jenny', ['Mike'], 54, {c: 'Nancy'}, 'Carl', 43]
const categorizeItems = (duplicatedArray) =>{
elements = {};
duplicatedArray.forEach(function(element) {
elements[element + typeof element] = element;
});
import time
def call_when_time_is_come(seconds, letter):
time.sleep(seconds)
print(letter)
def print_letters_of_array_exponential(array):
for index,letter in enumerate(array):
call_when_time_is_come(2**index, letter)
@puskuruk
puskuruk / saySymbolsPair.js
Last active January 14, 2020 01:56
Control curly brackets and square brackets is closing properly or not
const brackets = [{
name: "object",
bracketPair: "{}"
},
{
name: 'array',
bracketPair: "[]"
},
{
#Times start
#it's a ruby style times function
def times(number, anotherFunc, *args):
time = range(number)
for num in time:
anotherFunc(*args)
#example usage:
#def a(string):
# print(string)
//settting globalIndex to manage for loops easily end
//setting our constantVariable to use in our example
const constantVariableDefinedGlobally = 4;
//setted our constantVariable to use in our example
console.log(`=====================================================`);
console.log(` --------------------------------------------------- `);
console.log(`========= started of trying to change constant variable ==============`);
try{
//settting globalIndex to manage for loops easily start
//because our topic is not loops for now
const globalIndex = 3;
//settting globalIndex to manage for loops easily end
//=====================================================
//functionwithLet function start
const functionwithLet = () =>{
for(let i=0;globalIndex > i; i++){

Host to Host a Rails App on a Home Server

Hosting services like Heroku and Amazon EC2 are nice. That is, until they cost money. Some things are worth running on your own hardware, especially when the cost and Terms of Service requirements outweigh the expense of rolling your own hosting.

I am writing this because I recently had to figure all this out in order to host a personal blog off a Raspberry Pi, and I thought I'd share what I learned. This guide assumes that you already know how to install Ruby and you know how to use Rails. If you don't, look those up first before coming back to this guide.

Prerequisites

  • Ruby >=2.0
  • Rails >=4.0
  • Nginx
@puskuruk
puskuruk / 2018-photo.md
Created January 1, 2018 16:35 — forked from usmanakram232/2018-photo.md
52 Week Photography Challange 2018

52 Week Photography Challange 2018

This year again photographer Dale Foshe has put up 52 week photography chanllange here.

Following, I just list them again for my ease of use. 😆

  • Week 1 Vision: Look Ahead New year. New beginnings. New you. Look ahead. Interpret as you wish.
  • Week 2 Composition: Color Harmony Get out your color wheel. Do opposites attract? Can there be harmony with opposite colors? Does the Hulk wear purple pants? Mix warm and cool colors.
  • Week 3 Technical: Full Manual While the camera often determines shutter speed and aperture for the photographer, it doesn't know your creative intent. This week, challenge your self to assume creative control over the camera by using full manual mode. Select a subject where varying the aperture and / or shutter speed helps enhance the composition and visual qualities of the image.
  • Week 4 Creative: Quiet Moment Peace