Skip to content

Instantly share code, notes, and snippets.

Avatar
🌒
there is no dark side in the moon, really.

Ali Oğuzhan Yıldız alioguzhan

🌒
there is no dark side in the moon, really.
View GitHub Profile
@alioguzhan
alioguzhan / clean.sh
Created Apr 26, 2017
React-Native Cleaner Script
View clean.sh
#!/bin/bash
Green='\033[0;32m' # Green
Yellow='\033[0;33m' # Yellow
Reset='\033[m'
echo -e "Cleaning ${Yellow}\$TMPDIR${Reset}..."
rm -fr $TMPDIR/react* ;
echo -e "${Green}Done."
echo -e "${Reset}Cleaning ${Yellow}watchman cache${Reset}...";
@alioguzhan
alioguzhan / disable_tracker.sh
Created Feb 9, 2017 — forked from DanyHenriquez/disable_tracker.sh
Disable tracker Ubuntu 16.04
View disable_tracker.sh
echo -e "\nHidden=true\n"|sudo tee --append /etc/xdg/autostart/tracker-extract.desktop
echo -e "\nHidden=true\n"|sudo tee --append /etc/xdg/autostart/tracker-miner-apps.desktop
echo -e "\nHidden=true\n"|sudo tee --append /etc/xdg/autostart/tracker-miner-fs.desktop
echo -e "\nHidden=true\n"|sudo tee --append /etc/xdg/autostart/tracker-miner-user-guides.desktop
echo -e "\nHidden=true\n"|sudo tee --append /etc/xdg/autostart/tracker-store.desktop
gsettings set org.freedesktop.Tracker.Miner.Files crawling-interval -2
gsettings set org.freedesktop.Tracker.Miner.Files enable-monitors false
tracker reset --hard
@alioguzhan
alioguzhan / gif.sh
Created May 19, 2016
Bash script to create gif from vide with ffmpeg
View gif.sh
#!/bin/sh
global_palette="/tmp/global_palette.png"
filters="fps=$5,scale=$6:-1:flags=lanczos"
ffmpeg -v error -ss $1 -t $2 -i $3 -vf "$filters,palettegen" -y $global_palette
ffmpeg -v error -ss $1 -t $2 -i $3 -i $global_palette -lavfi "$filters [x]; [x][1:v] paletteuse" -y $4
View jsbin.OjAvaZIX.css
td {
background: red;
padding-left: 5px;
padding-right: 5px;
color: white;
font-size: 20px;
font-weight: bold;
width: 40px;
height: 60px;
text-align: center;
@alioguzhan
alioguzhan / convert_to_ascii
Created Nov 16, 2013
Takes a string as param, and convert all turkish (non-ascii) chars to ascii.
View convert_to_ascii
def get_ascii_name(name):
""" returns a non-ascii -turkish- string to ascii one """
name = name.lower()
map = {u"ı": "i",
u"ğ": "g",
u"ç": "c",
u"ü": "u",
u"ö": "o",
u"ş": "s"}
uname = []
View gist:7070012
(defn handle-register [username email pass1 pass2]
(if(has-values?[username email pass1 pass2])
(json {:resp "Please fill all fields."}))
(if(not(= pass1 pass2))
(json {:resp "Passwords dont match."}))
(if(not(nil?(db/get-user-by-username username)))
(json {:username "This username already exists."}))
View jsbin.ItElEx.html
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.2/jquery.min.js"></script>
<script src="http://documentcloud.github.io/underscore/underscore-min.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
<div class="cardRates">
@alioguzhan
alioguzhan / toObject.js
Last active Dec 24, 2015
convert an 'array' which includes multiple (different) objects as element into 'one object'.
View toObject.js
var toObject = function(obj){
var newObj = {};
for(var i = 0; i<obj.length; i++){
for(var k in obj[i]){
if(obj[i].hasOwnProperty(k)) {
newObj[k] = obj[i][k];
}
}
}
return newObj;
View validate.js
// Validate Phone Format
var filter = /^\(?(\d{3})\)?[- ]?(\d{3})[- ]?(\d{4})$/;
// Validate Email Format
var filter = /^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,6}|[0-9]{1,3})(\]?)$/;
// Validate Date Format (Short Date mm/dd/yyyy)
var filter = /^(0?[1-9]|1[012])\/(0?[1-9]|[12][0-9]|3[01])\/(?:19|20|21\d{2})/;