Skip to content

Instantly share code, notes, and snippets.

View ebsaral's full-sized avatar

Emin Buğra Saral ebsaral

View GitHub Profile
@ebsaral
ebsaral / ebsftp.sh
Last active December 20, 2015 23:29
#!/bin/bash
echo "*** WELCOME TO FTP UPLOAD SCRIPT written by Emin Bugra Saral ***"
echo
# Variables
SOURCE_PATH="$1"
TARGET_PATH="$2"
FTP_SERVER_FILE="$(basename $0)_server.txt" # Info file's name
FTP_SERVER_FILE_DIR="$(pwd)/$FTP_SERVER_FILE" # Info file's directory which is current one
@ebsaral
ebsaral / gist:4408664
Last active October 27, 2016 12:59
Brightness and Contrast adjustment in InDesign CS4 [MAC]
-- Author : Emin Bugra Saral
-- Author Website : http://www.eminbugrasaral.com
-- Sources : http://www.adobe.com/products/indesign/scripting/pdfs/InDesignCS4_ScriptingGuide_AS.pdf
-- Purpose : Changing brightness and contrast of an image in InDesign CS4 by using Photoshop CS4
-- Warning: Please be sure you read "readme.txt"
tell application "Adobe InDesign CS4"
activate
-- default values :
set defaultBValue to 80
@ebsaral
ebsaral / gist:4132145
Created November 22, 2012 17:05
Capture frames from a webcam in MATLAB
function [ ] = takepicture( framenumber , frequency , enable_preview, foldername)
%TAKEPICTURE This function takes a snapshot from webcam
% framenumber = how many frames to be recorded
% frequency = if it's 5, 1 in 5 frames will be recorded. The higher is the
% faster.
% enable_preview = set true if you wanna preview the cam
% foldername = the folder where the pictures will be saved
% Close variables
close all;
@ebsaral
ebsaral / cthread.c
Created November 22, 2012 17:01
A simple thread example (session control) in C
#include <stdio.h>
#include <unistd.h>
#include <time.h>
#include <pthread.h> // necessary
#include <stdlib.h>
// Session limit in seconds
#define SESSION_TIME 60
// Global last interaction variable