Skip to content

Instantly share code, notes, and snippets.

View unique1984's full-sized avatar
💭
I may be slow to respond.

Yasin KARABULAK unique1984

💭
I may be slow to respond.
View GitHub Profile
@ilkermanap
ilkermanap / real_distance.py
Last active January 19, 2019 22:09
Distance between two points with earth curve
def distance(lt1,ln1, lt2,ln2, in_meters = True):
"""
distance between two coordinates in meters
or in
"""
R = 6371000 # earth radius
theta1 = lt1 * PI / 180
theta2 = lt2 * PI / 180
delta_theta = (lt2 -lt1) * PI / 180
delta_fi = (ln2 - ln1) * PI / 180
@sarpdorukaslan
sarpdorukaslan / phpstorm.protokol.md
Last active February 24, 2019 06:03
phpstorm için protokol (URI) işleyici ekler [Ubuntu \ xFCE]

mimeapps.list içine [Added Associations] altında bir satıra
aşağıdaki satırı ekle

x-scheme-handler/phpstorm=phpstorm-php.desktop

phpstorm-php.desktop içeriği

[Desktop Entry]
Type=Application
Name=PHPStorm IDE
@RomainMarecat
RomainMarecat / .gitlab-ci.sh
Last active April 25, 2022 03:56
Simple gitlab-ci configuration symfony
#!/bin/bash
# Install dependencies only for Docker.
[[ ! -e /.dockerinit ]] && exit 0
set -xe
# Update packages and install composer and PHP dependencies.
apt-get update -yqq
apt-get install git libcurl4-gnutls-dev libicu-dev libmcrypt-dev libvpx-dev libjpeg-dev libpng-dev libxpm-dev zlib1g-dev libfreetype6-dev libxml2-dev libexpat1-dev libbz2-dev libgmp3-dev libldap2-dev unixodbc-dev libpq-dev libsqlite3-dev libaspell-dev libsnmp-dev libpcre3-dev libtidy-dev phpunit -yqq
@asimmittal
asimmittal / scrapeUsingJQuery.js
Created October 4, 2017 16:01
JqueryScraper
console.log("---> Running");
const curl = require("curl");
const jsdom = require("jsdom");
const url = "http://www.imdb.com/list/ls004489992/";
curl.get(url, null, (err,resp,body)=>{
if(resp.statusCode == 200){
parseData(body);
}
@moiseevigor
moiseevigor / xstat
Last active October 12, 2022 06:32
xstat bash function to get file creation time on Linux with EXT4
xstat() {
for target in "${@}"; do
inode=$(ls -di "${target}" | cut -d ' ' -f 1)
fs=$(df "${target}" | tail -1 | awk '{print $1}')
crtime=$(sudo debugfs -R 'stat <'"${inode}"'>' "${fs}" 2>/dev/null |
grep -oP 'crtime.*--\s*\K.*')
printf "%s\t%s\n" "${crtime}" "${target}"
done
}
<?php
require_once __DIR__.'/V8JsNodeModuleLoader_FileAccessInterface.php';
require_once __DIR__.'/V8JsNodeModuleLoader_NormalisePath.php';
/**
* Simple Node.js module loader for use with V8Js PHP extension
*
* This class understands Node.js' node_modules/ directory structure
* and can require modules/files from there.
*
@ianmackinnon
ianmackinnon / match.c
Created August 8, 2012 12:01
C Regex multiple matches and groups example
# gcc -Wall -o match match.c && ./match
#
#include <stdio.h>
#include <string.h>
#include <regex.h>
@tlhunter
tlhunter / average-geolocation.js
Created May 17, 2017 18:00
Calculate the center/average of multiple GeoLocation coordinates
/**
* Calculate the center/average of multiple GeoLocation coordinates
* Expects an array of objects with .latitude and .longitude properties
*
* @url http://stackoverflow.com/a/14231286/538646
*/
function averageGeolocation(coords) {
if (coords.length === 1) {
return coords[0];
}
@CanNuhlar
CanNuhlar / TDK_Scraper.py
Created August 2, 2018 19:57
Created from terminal
# -*- coding: utf-8 -*-
import requests
from HTMLParser import HTMLParser
import re
class PageNumParser(HTMLParser):
def handle_data(self, data):
if "sayfanın" in data:
getContent(int(re.search(r'\d+', data).group()))
class wordParser(HTMLParser):
@unique1984
unique1984 / installer.sh
Last active November 24, 2023 21:00
OpenZFS - ZFS as a Root File System on Debian Bullseye
#!/usr/bin/env bash
###########################################################################################################
# Bash Script of this Documentation :
# https://openzfs.github.io/openzfs-docs/Getting%20Started/Debian/Debian%20Bullseye%20Root%20on%20ZFS.html#debian-bullseye-root-on-zfs
#
# Copyright © 2022 - installer.sh
# Yasin Karabulak
# info@yasinkarabulak.com
# https://github.com/unique1984
#