Skip to content

Instantly share code, notes, and snippets.

View mucahit's full-sized avatar
👨‍💻

Mucahit Tutuncu mucahit

👨‍💻
View GitHub Profile
@mucahit
mucahit / progress.1h.sh
Last active July 22, 2018 17:35 — forked from aurorabbit/progress.10s.sh
Bitbar timely progress bar
#!/usr/bin/env bash
# Progress Bar of Year, Month and Day: See the big picture.
#
# by Mucahit (http://github.com/mucahit)
#
# <bitbar.title>Progress Bar of Year, Month and Day</bitbar.title>
# <bitbar.version>v1.0</bitbar.version>
# <bitbar.author>Mucahit</bitbar.author>
# <bitbar.author.github>Mucahit</bitbar.author.github>
@mucahit
mucahit / see_unfollowers.js
Created June 25, 2018 23:17
List of your Twitter unfollowers.
let list = [];
$('.ProfileCard-content').each(function() {
const status = $(this)
.find('.FollowStatus')
.text();
if (status != 'Follows you') {
list.push($(this).find(".u-linkComplex-target").text())
}
@mucahit
mucahit / facebook-share.js
Last active May 7, 2018 16:19
Share Link and Text on Facebook using Javascript.
let base_url = "https://www.facebook.com/sharer/sharer.php?"; // Base url
// Params
const params = {
u: "http://google.com",
quote: "Replace this with your text",
};
for(const prop in params) base_url += `&${prop}=${encodeURIComponent(params[prop])}`;
@mucahit
mucahit / twitter-share.js
Created May 7, 2018 00:17
Share Link, Hashtag, Text or Username on Twitter using Javascript.
let base_url = "http://twitter.com/share?"; // Base url
// Params
const params = {
url: "http://google.com",
text: "Replace this with your text",
via: "sometwitterusername",
hashtags: "hashtag1,hashtag2"
};
@mucahit
mucahit / .zshrc
Created September 4, 2015 11:50
Laravel aliases
alias migrate='php artisan migrate'
alias rollback='php artisan migrate:rollback'
alias seed='php artisan db:seed'
@mucahit
mucahit / default.sublime-keymap
Created August 24, 2015 07:54
My sublime key bindings
[
{ "keys": ["super+v"], "command": "paste_and_indent" },
{ "keys": ["super+shift+v"], "command": "paste" },
{ "keys": ["super+shift+r"], "command": "reindent" },
{ "keys": ["alt+tab"], "command": "indent" },
{ "keys": ["shift+tab"], "command": "unindent" },
{ // TodoReview: Open Files
"keys": ["control+shift+t"],
"command": "todo_review",
}
@mucahit
mucahit / Preferences.sublime-settings
Created August 24, 2015 07:53
My sublime preferences
{
"always_show_minimap_viewport": true,
"bold_folder_labels": true,
"color_scheme": "Packages/Material Theme/schemes/Material-Theme-Darker.tmTheme",
"ignored_packages":
[
"Vintage"
],
"line_padding_bottom": 3,
"line_padding_top": 3,
@mucahit
mucahit / box-example.html
Created July 21, 2015 12:13
for gokhanakkurt
<div class="row">
<div class="col-sm-6 col-md-4">
<div class="thumbnail">
<img src="http://lorempixel.com/400/200" alt="...">
<div class="caption">
<h4><a href="#">Ahmet Çakar</a></h4>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Alias rerum laborum provident, similique error hic qui nemo, dolorem veritatis modi facilis eaque dicta enim ipsam accusamus sed. Iure, commodi nobis!</p>
<p><a href="#"><i class="fa fa-clock-o"></i> 3 Hours Ago</a></p>
<p><button class="btn btn-warning">Delete</button> &nbsp; <button class="btn btn-success">Approve</button></p>
</div>
@mucahit
mucahit / _helpers.scss
Created July 17, 2015 11:45
vertical-align center helper
.vertical-center{
display:flex;
justify-content:flex-end;
align-items:center;
}
@mucahit
mucahit / parse_duration.php
Created July 7, 2015 16:03
Youtube Api Duration to Seconds
function parse_duration($duration, $resultType){
$matches = array();
preg_match('/^(-|)?P([0-9]+Y|)?([0-9]+M|)?([0-9]+D|)?T?([0-9]+H|)?([0-9]+M|)?([0-9]+S|)?$/', $duration, $matches);
if(!empty($matches)){
foreach($matches as &$match){
$match = preg_replace('/((?!([0-9]|-)).)*/', '', $match);
}