Skip to content

Instantly share code, notes, and snippets.

View mehmetboraezer's full-sized avatar

Mehmet Bora Ezer mehmetboraezer

View GitHub Profile
@mehmetboraezer
mehmetboraezer / pre_post_hook_prompt.md
Created April 10, 2020 13:32 — forked from jeandat/pre_post_hook_prompt.md
Pre & Post hook for bash prompt (terminal)

PRE / POST Hook for Bash Prompt

Explained here.

AT_PROMPT=1 
# This will run before any command is executed.
function PreCommand() {
  if [ -z "$AT_PROMPT" ]; then
 return
@mehmetboraezer
mehmetboraezer / lambda-basic-auth.js
Created February 6, 2020 14:24 — forked from lmakarov/lambda-basic-auth.js
Basic HTTP Authentication for CloudFront with Lambda@Edge
'use strict';
exports.handler = (event, context, callback) => {
// Get request and request headers
const request = event.Records[0].cf.request;
const headers = request.headers;
// Configure authentication
const authUser = 'user';
const authPass = 'pass';
Byobu is a suite of enhancements to tmux, as a command line
tool providing live system status, dynamic window management,
and some convenient keybindings:
F1 * Used by X11 *
Shift-F1 Display this help
F2 Create a new window
Shift-F2 Create a horizontal split
Ctrl-F2 Create a vertical split
Ctrl-Shift-F2 Create a new session
@mehmetboraezer
mehmetboraezer / quicktime-hangouts-recording.md
Created October 15, 2019 08:25 — forked from caseywatts/quicktime-hangouts-recording.md
Quicktime Hangouts Recording (using soundflower for audio)

Short link to this page: caseywatts.com/quicktime

Other gists & tricks: http://caseywatts.com/gists-and-tricks

Quicktime + Hangouts Recording

Scenario: You want to talk with someone over google hangouts (like for a user study), and you want to record BOTH:

  • the system output audio (from them)
  • the microphone audio (from you)
@mehmetboraezer
mehmetboraezer / dark-theme.md
Last active January 26, 2019 19:07
Youtube dark theme activation for Firefox

Youtube dark theme activation (for Firefox)

  • Open developer console
  • Run following code
    var cookieDate = new Date();
    cookieDate.setFullYear(cookieDate.getFullYear( ) + 1);
    document.cookie="VISITOR_INFO1_LIVE=fPQ4jCL6EiE; expires=" + cookieDate.toGMTString( ) + "; path=/";
  • Click profile picture and switch to dark theme
@mehmetboraezer
mehmetboraezer / clamav-mac.md
Created January 16, 2019 08:12 — forked from Uchean/clamav-mac.md
Get ClamAV running on Mac OS X (using Homebrew)

Get ClamAV running on Mac OS X (using Homebrew)

The easiest way to get the ClamAV package is using Homebrew

$ brew install clamav

Before trying to start the clamd process, you'll need a copy of the ClamAV databases.

Create a freshclam.conf file and configure as so

@mehmetboraezer
mehmetboraezer / analytics.rb
Created January 9, 2019 14:07 — forked from CoryFoy/analytics.rb
An example of calling the Analytics API using machine creds and the V4 API from Ruby
require 'google/apis/analyticsreporting_v4'
require 'googleauth'
include Google::Apis::AnalyticsreportingV4
include Google::Auth
VIEW_ID = "12345678" #your profile ID from your Analytics Profile
SCOPE = 'https://www.googleapis.com/auth/analytics.readonly'
@client = AnalyticsReportingService.new
@mehmetboraezer
mehmetboraezer / movie.2.gif.md
Created January 6, 2019 20:21
Convert movies to gif in OS X Mac

#OS X Movie to animated GIF

ffmpeg -i movie-name.mp4 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=0 --delay=3 > movie-name.gif

##Options

  • -r 10 tells ffmpeg to reduce the frame rate from 25 fps to 10
  • -s 600x400 tells ffmpeg the max-width and max-height
@mehmetboraezer
mehmetboraezer / bitcoin_calculator.py
Last active November 22, 2018 11:56
Bitcoin price comparer script for coinmon and paribu
##
# Usage -> python bitcoin_calculator.py [bitcoin amount]
# Example -> python bitcoin_calculator.py 0.2123
##
import json
import os
import re
import sys
# Coinmon
@mehmetboraezer
mehmetboraezer / taggable.rb
Created October 19, 2018 12:29 — forked from ayrton/taggable.rb
Testing Active Support concerns with rspec in isolation. See first comment for more information.
module Taggable
extend ActiveSupport::Concern
included do
attr_accessible :tags
after_save :set_tags
after_destroy :unset_tags
end