Skip to content

Instantly share code, notes, and snippets.

@ulasozguler
ulasozguler / timeformat.sh
Created June 8, 2015 19:00
Changes OS X menu bar time format to whatever the fuck you want.
#!/bin/bash
killall -KILL SystemUIServer
killall -KILL SystemUIServer &> /dev/null
echo "Press CTRL+C when format changes."
if [ -z "$1" ]; then format="YYYY.MM.dd HH:mm:ss"; else format="$1"; fi
while true
do
defaults write com.apple.menuextra.clock "DateFormat" "$format"
done
@ulasozguler
ulasozguler / hotfix_shortcut.sh
Created October 8, 2015 19:44
Create and finish a hotfix with currently uncommited files. Usage: hotfixx branch_name "commit message"
hotfixx() {
git stash
git flow hotfix start $1
git stash pop
git commit -am "$2"
export GIT_MERGE_AUTOEDIT=no
git flow hotfix finish -Fn $1
unset GIT_MERGE_AUTOEDIT
git push origin develop
git push origin master
@ulasozguler
ulasozguler / hexagons.js
Created October 25, 2016 17:07 — forked from zackthehuman/hexagons.js
Drawing a hexagonal grid with HTML canvas
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Canvas Hexagonal Map</title>
<style type="text/css">
canvas {
border:0;
display:block;
margin:0 auto;
# This gist is compatible with Ansible 1.x .
# For Ansible 2.x , please check out:
# - https://gist.github.com/dmsimard/cd706de198c85a8255f6
# - https://github.com/n0ts/ansible-human_log
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
@ulasozguler
ulasozguler / remove_sl_icon.sh
Created February 4, 2017 18:58
Remove spotlight icon from menu bar.
cd /System/Library/CoreServices/Spotlight.app/Contents/MacOS
sudo cp Spotlight Spotlight.bak
sudo perl -pi -e 's|(\x00\x00\x00\x00\x00\x00\x47\x40\x00\x00\x00\x00\x00\x00)\x42\x40(\x00\x00\x80\x3f\x00\x00\x70\x42)|$1\x00\x00$2|sg' Spotlight
cmp -l Spotlight Spotlight.bak
sudo codesign -f -s - Spotlight
sudo killall Spotlight
@ulasozguler
ulasozguler / open_in_iterm.applescript
Created February 5, 2017 19:43
Open in iTerm action for Finder
-- Adapted from these sources:
-- http://peterdowns.com/posts/open-iterm-finder-service.html
-- https://gist.github.com/cowboy/905546
--
-- Modified to work with files as well, cd-ing to their container folder
on run {input, parameters}
tell application "Finder"
set my_file to first item of input
set is_folder to (do shell script "file -b " & quoted form of (POSIX path of my_file))
if is_folder ends with "directory" then
@ulasozguler
ulasozguler / fb_bugs.py
Last active October 7, 2017 10:05
A better list of subscribed Facebook bugs
import json
import requests
headers = {
'pragma': 'no-cache',
'origin': 'https://developers.facebook.com',
'accept-language': 'en-GB,en;q=0.8,en-US;q=0.6,tr;q=0.4',
'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36',
'content-type': 'application/x-www-form-urlencoded',
@ulasozguler
ulasozguler / test.json
Last active December 25, 2019 19:39
test.json
{
"nodes": [
{
"id": "Academy Map (T4)"
},
{
"id": "Academy Map (T7)"
},
{
"id": "Academy Map (T11)"
@ulasozguler
ulasozguler / coronatr.js
Last active December 10, 2020 19:33
Userscript for showing additional information in covid19.saglik.gov.tr
// ==UserScript==
// @name Covid19 TR enhancer
// @namespace https://gist.github.com/ulasozguler/95d4a081da95e941c2fa3dc672ae624b
// @version 0.7
// @description New information for official Covid-19 info website for Turkey.
// @author You
// @match https://covid19.saglik.gov.tr/
// @match https://covid19.saglik.gov.tr/TR-66935/genel-koronavirus-tablosu.html?chart=1
// @grant GM_addStyle
// @require https://cdn.jsdelivr.net/npm/chart.js@2.8.0
@ulasozguler
ulasozguler / remove_icons.reg
Created February 2, 2021 05:54
Manage icons in "This PC" in Win 10
Windows Registry Editor Version 5.00
; Remove Desktop From This PC
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}]
; Remove Videos From This PC
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{A0953C92-50DC-43bf-BE83-3742FED03C9C}]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{f86fa3ab-70d2-4fc7-9c99-fcbf05467f3a}]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{A0953C92-50DC-43bf-BE83-3742FED03C9C}]