I hereby claim:
- I am serkanyersen on github.
- I am serkanyersen (https://keybase.io/serkanyersen) on keybase.
- I have a public key ASDGZSxXT6lhgn0GblngxWpqpTvJd_2qFA8mDR8eZYcG9Ao
To claim this, I am signing this object:
| #!/bin/bash | |
| ###################################### | |
| ## Utilities | |
| ###################################### | |
| success () { | |
| printf "\r\033[2K [ \033[00;32mOK\033[0m ] $1\n" | |
| } | |
| info () { |
| { | |
| "eslint/disable": { | |
| "prefix": "eslint-disable", | |
| "description": "To temporarily disable rule warnings in your file", | |
| "body": [ | |
| "/* eslint-disable $rules */" | |
| ] | |
| }, | |
| "eslint/enable": { | |
| "prefix": "eslint-enable", |
I hereby claim:
To claim this, I am signing this object:
| function getDistanceFromLatLonInKm(lat1, lon1, lat2, lon2) { | |
| var R = 6371, // Radius of the earth in km | |
| dLat = deg2rad(lat2 - lat1), // deg2rad below | |
| dLon = deg2rad(lon2 - lon1), | |
| a = Math.sin(dLat / 2) * Math.sin(dLat / 2) + | |
| Math.cos(deg2rad(lat1)) * Math.cos(deg2rad(lat2)) * | |
| Math.sin(dLon / 2) * Math.sin(dLon / 2), | |
| c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a)), | |
| d = R * c; // Distance in km |
| // 1. load up youtube.com | |
| // 2. open console and run this code | |
| var jq = document.createElement('script'); | |
| jq.src = "https://code.jquery.com/jquery-latest.min.js"; | |
| document.getElementsByTagName('head')[0].appendChild(jq); | |
| // After that code has run, copy paste the following code and check results in console. | |
| // Don't forget to add your own API key there |
| var Car = Backbone.Model.extend({ | |
| defaults:{ | |
| engine: 'gasoline', | |
| hp: 0, | |
| doors: 4, | |
| color: 'generic' | |
| }, | |
| engine: function(){ | |
| return 'Wroomm'; | |
| } |
As configured in my dotfiles.
start new:
tmux
start new with session name:
| function __autoload($class_name) { | |
| # If file name contains underscore convert them to folder marks | |
| if (strpos($class_name, '_') !== false) { | |
| $className = str_replace("_", "/", $class_name); | |
| } else { | |
| $className = $class_name; | |
| } | |
| # This where we usually contain all our classes |
| [ | |
| /* Eclipse keys */ | |
| // Go to anything menu | |
| { "keys": ["ctrl+t"], "command": "show_overlay", "args": {"overlay": "goto", "show_files": true} }, | |
| // Shift+Enter to add a new line without going to end of the line | |
| { "keys": ["shift+enter"], "command": "run_macro_file", "args": {"file": "Packages/Default/Add Line.sublime-macro"} }, | |
| // Move lines up and down | |
| { "keys": ["alt+up"], "command": "swap_line_up" }, | |
| { "keys": ["alt+down"], "command": "swap_line_down" }, | |
| // Close all tabs without closing sublime |
| [ | |
| /* Mac os x does not use home / end keys like windows. These keys fixes this behavior */ | |
| // Move selection to beggining of the line, windows style | |
| { "keys": ["shift+home"], "command": "move_to", "args": {"extend":true, "to": "bol"}}, | |
| // Move selection to end of the line, windows style | |
| { "keys": ["shift+end"], "command": "move_to", "args": {"extend":true, "to": "eol"}}, | |
| // Move cursor to beggining of the line, windows style | |
| { "keys": ["home"], "command": "move_to", "args": {"to": "bol"}}, | |
| // Move cursor to end of the line, windows style | |
| { "keys": ["end"], "command": "move_to", "args": {"to": "eol"}}, |