This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import base64 | |
import random | |
def generate_16char_base32(pre): | |
""" | |
Encode a string of 16 length in base32 | |
with a given string - maximum length of 10 chars - | |
Note: 10 char = 16 char string in base32 | |
Warning: Decoding is not a part of this example |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// In order to display a Open Graph Action in your Facebook Share Dialog (FBDialog), you can construct your code like this: | |
NSMutableDictionary<FBOpenGraphAction> *action = (NSMutableDictionary<FBOpenGraphAction> *)[FBGraphObject graphObject]; | |
NSMutableDictionary *graphObject = [FBGraphObject openGraphObjectForPostWithType:@"video.movie" | |
title:@"My movie." | |
image:@"http://www.mymovie.com/poster.jpg" | |
url:@"http://www.mymovie.com" | |
description:@"This movie may contain adult material."]; | |
action[@"movie"] = graphObject; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'capybara' | |
class CapybaraHelper | |
attr_accessor :session | |
def initialize | |
# Register Chrome driver | |
# You might need to install Chrome Driver to make it run (e.g 'brew install chromedriver') | |
Capybara.register_driver :chrome do |app| | |
Capybara::Selenium::Driver.new(app, :browser => :chrome) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Address(models.Model): | |
name = models.CharField(max_length=20) | |
owner = models.ForeignKey('another_app.Owner') | |
class Meta: | |
abstract = True | |
class HomeAddress(Address): | |
housekeeper = models.CharField(max_length=50) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Address(models.Model): | |
name = models.CharField(max_length=20) | |
owner = models.ForeignKey('another_app.Owner') | |
class HomeAddress(Address): | |
housekeeper = models.CharField(max_length=50) | |
class WorkAddress(Address): |
OlderNewer