Skip to content

Instantly share code, notes, and snippets.

View imesut's full-sized avatar

Mesut Yılmaz imesut

View GitHub Profile
@imesut
imesut / 1.index.js
Last active July 28, 2024 19:52
Scripts for "Infographic - A Bus Trip" index.js script parses open street maps rouet data and prepares a combined gps path as svg.
// npm i polyline
// node index.js
let fs = require('fs');
let polyline = require('polyline');
let file = fs.readFileSync("route.json");
let json = JSON.parse(file.toString())
@imesut
imesut / engage.command.output
Created June 17, 2024 12:43
Captain's Log Engage Script Output
Last login: Mon Jun 17 15:41:46 on ttys001
❯ /Users/mesut/Desktop/engage.command ; exit;
> captainslog@1.0.0 publish
> npm run build; netlify deploy --dir=public --prod;
> captainslog@1.0.0 build
> tinacms dev -c "hugo; npm run images"; npm run pdf
4 issues were found when checking AAR metadata:
1. Dependency 'androidx.room:room-runtime:2.6.0' requires libraries and applications that
depend on it to compile against version 34 or later of the
Android APIs.
:st_blue_sdk is currently compiled against android-33.
Recommended action: Update this project to use a newer compileSdk
of at least 34, for example 34.
@imesut
imesut / DropRepeatingFramesInVideo.sh
Created April 21, 2024 13:21
Deletes repeating frames ifexist more than 2 times. Then it can be merged as a video file.
#!/bin/bash
# BEFORE THE SCRIPT RUN
# mkdir frame
# ffmpeg -i video.mp4 -r 30 frame/$filename%04d.jpg
# cd frame
# AFTER THE SCRIPT RUN
# ffmpeg -framerate 30 -pattern_type glob -i '*.jpg' -c:v libx264 -pix_fmt yuv420p ../out.mp4
@imesut
imesut / stringcatalog-script.py
Created December 26, 2023 11:27
A script to fetch localization from a tabular file format (Excel/CSV) and prepare iOS String Catalog compatible JSON.
import pandas as pd
import json
def prepareCSV():
fullList = []
df = pd.read_json("swiper.json")
strings = df["strings"]
print(strings)
for localization_key in strings.keys():
if strings[localization_key].keys().__contains__("localizations"):
@imesut
imesut / pivotView.js
Created January 10, 2023 10:16
Creates a Pivot View for Quotations, will be used in Retool
// Tip: assign your external references to variables instead of chaining off the curly brackets.
let list = quotationsList.data
var flattenedList = []
for (let index = 0; index < list.Id.length; index++) {
flattenedList.push({
Id: list.Id[index],
MPN: list.MPN[index],
@imesut
imesut / complete_privacy.md
Created December 5, 2022 17:31
Complete Privacy Policy for my iOS Apps

Complete Privacy Policy

As a user of one of my applications below,

  1. SWiper
  2. Dayly

You should know that we do not collect your private information or personal data. These apps run completely offline and don't gather or share any data with any parties, including us. what happens on your device stays on your device.

Unless this privacy policy is revised (a revision would be clearly visible on your end), any of the privacy situations is related to your device in use as a result of the black-box nature of our apps above.

@imesut
imesut / BlockAllExes.BAT
Created March 14, 2022 18:21
This script blocks the incoming and outcoming network traffic for the exe files in the runned script or subfolders. Should be runned as administrator.
:: Thanks to https://security.stackexchange.com/a/87516/275653
@ setlocal enableextensions
@ cd /d "%~dp0"
for /R %%a in (*.exe) do (
netsh advfirewall firewall add rule name="Blocked with Batchfile %%a" dir=out program="%%a" action=block enable=yes profile=any
netsh advfirewall firewall add rule name="Blocked with Batchfile %%a" dir=in program="%%a" action=block enable=yes profile=any
)
@imesut
imesut / generateOdps.py
Created May 22, 2020 00:31
Generate PDFs with custom field from pptx → odp
import zipfile, os
codes = ["insert", "codes", "here"]
prevcode = "XXXXXXX"
count = 1
for code in codes:
with open("template/content.xml", "r") as codefileR:
newcontent = codefileR.read().replace(prevcode, code)
@imesut
imesut / line.js
Created May 13, 2020 12:21
Public Transport Data - Transit Line Info
let forward_line = resp["lines"][0]
let backward_line = resp["lines"][1]
let retriever = (line) => {
var stops = resp.patterns.filter(x=>x.patternId == line.mostFrequentPatternId)
var selectedStops = stops[0].stopIds
for(i in selectedStops){
console.log("looking for: " + selectedStops[i])
console.log("result: " + resp.stops.filter(x => x.stopId == selectedStops[i])[0].stopName)