Skip to content

Instantly share code, notes, and snippets.

View emrahgunduz's full-sized avatar

Emrah Gündüz emrahgunduz

  • @Impressions-app
  • California
View GitHub Profile
@emrahgunduz
emrahgunduz / WebImageDownloader.cpp
Last active January 25, 2023 21:15
Web Image Downloader For Unreal Engine 4 -- Do not forget to change the include and API key in your own classs, if you simply copy-pasting this.
// (c) 2016 Markakod
#include "HitMe.h"
#include "WebImageDownloader.h"
UWebImageDownloader* UWebImageDownloader::GetWebImageDownloader(FString WebImageName, FString URL, bool& IsValid)
{
IsValid = false;
UWebImageDownloader *Object = NewObject<UWebImageDownloader>();
@emrahgunduz
emrahgunduz / AddToYourCppFile.cpp
Last active January 20, 2021 19:37
Image to Texture on UE4
static EImageFormat::Type GetJoyImageFormat(EJoyImageFormats JoyFormat)
{
switch (JoyFormat) {
case EJoyImageFormats::JPG: return EImageFormat::JPEG;
case EJoyImageFormats::PNG: return EImageFormat::PNG;
case EJoyImageFormats::BMP: return EImageFormat::BMP;
case EJoyImageFormats::ICO: return EImageFormat::ICO;
case EJoyImageFormats::EXR: return EImageFormat::EXR;
case EJoyImageFormats::ICNS: return EImageFormat::ICNS;
}
@emrahgunduz
emrahgunduz / PackageDownloader.cpp
Created November 14, 2016 12:55
Package Downloader And Mounter For Unreal Engine 4 -- Do not forget to correct the include and api name if you are copy pasting this code
#include "HitMe.h"
#include "PackageDownloader.h"
#include "IPlatformFilePak.h"
#include "HitMeSingleton.h"
UPackageDownloader* UPackageDownloader::GetPackageDownloader(FString PackageName, FString URL, bool& IsValid)
{
IsValid = false;
UPackageDownloader *Object = NewObject<UPackageDownloader>();
@emrahgunduz
emrahgunduz / add_ip.sh
Created December 22, 2016 16:54
Add multiple public ips to ec2 instance route
#!/bin/bash
#add routes for secondary IP addresses
MAC_ADDR=$(ifconfig eth0 | sed -n 's/.*ether \([a-f0-9:]*\).*/\1/p')
IP=($(curl http://169.254.169.254/latest/meta-data/network/interfaces/macs/$MAC_ADDR/local-ipv4s))
for ip in ${IP[@]:1}; do
echo "Adding IP: $ip"
ip addr add dev eth0 $ip/20
done
@emrahgunduz
emrahgunduz / call.bat
Last active September 19, 2020 12:04
This is what Unreal Engine calls from Windows for SSH connection to a macos machine -- use if ip of macos changes
"C:\Program Files (x86)\Epic Games\4.14\Engine\Extras\ThirdPartyNotUE\DeltaCopy\Binaries\ssh.exe" -i '/cygdrive/D/Unreal/HitMe/Packer/Provision/ios/RemoteToolChainPrivate.key' -p 22 emrahgunduz@10.0.1.29
@emrahgunduz
emrahgunduz / euler.py
Created January 27, 2017 08:58
Calculate e (euler's number), as long as you want
length = 50
n = 2
first_numerator = 3
first_denominator = 1
second_numerator = 8
second_denominator = 3
result = []
for i in xrange(length):
x = n
@emrahgunduz
emrahgunduz / JavascriptCaller.cpp
Created February 2, 2017 16:50
Javascript - Unreal connection via tick message calls
// Fill out your copyright notice in the Description page of Project Settings.
#include "ExpoKid.h"
#include "JavascriptCaller.h"
#include <string>
#include <stdlib.h>
#include <string.h>
#include <algorithm>
UJavascriptCaller::UJavascriptCaller(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer)
@emrahgunduz
emrahgunduz / imap-sync.sh
Created February 28, 2017 07:04
A bash script to clone multiple email-password combinations from one imap host to another. Requires imapsync installed/compiled and a csv file for email list. Uses port 993+ssl as default.
#!/bin/sh
# CSV file line example:
# some.name@domain.com,PASSWORD
if [ -z "$1" ]
then
echo "CSV file is not specified!"
exit 1
fi
@emrahgunduz
emrahgunduz / mail.rc
Last active April 5, 2019 10:14
Mailx and configuration for Cron email sending
set ask askcc append dot save crt
ignore Received Message-Id Resent-Message-Id Status Mail-From Return-Path Via D$
account forcron {
set smtp-use-starttls
set ssl-verify=ignore
set smtp-auth=login
set smtp=smtp://example.com:587
set from="Email Address <email@example.com>"
set smtp-auth-user=USERNAME
@emrahgunduz
emrahgunduz / CIImage_CVPixelBuffer.swift
Created August 4, 2020 22:05
BGRA to BGR convertion
import Foundation
import UIKit
extension CGImage {
public var cvPixelBuffer: CVPixelBuffer? {
let attrs = [
kCVPixelBufferCGImageCompatibilityKey: kCFBooleanTrue,
kCVPixelBufferCGBitmapContextCompatibilityKey: kCFBooleanTrue,
kCVPixelBufferMetalCompatibilityKey: kCFBooleanTrue
] as CFDictionary