Skip to content

Instantly share code, notes, and snippets.

View bbg's full-sized avatar
👍
"Our true mentor in life is science."   Mustafa Kemal Atatürk

Batuhan Göksu bbg

👍
"Our true mentor in life is science."   Mustafa Kemal Atatürk
View GitHub Profile
@bbg
bbg / nginx.conf
Created December 11, 2015 08:04
Nginx Configration
server {
server_name $domain_name;
listen 8080;
root /var/www;
index index.html index.php;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
location ~* \.(?:xml|ogg|mp3|mp4|ogv|svg|svgz|eot|otf|woff|ttf|css|js|jpg|jpeg|gif|png|ico)$ {
try_files $uri =404;
@bbg
bbg / sample.html
Created November 11, 2015 17:42
Event Listener Native Javascript width jQuery Style
<script type="text/javascript">
// self executing function here
(function() {
$ = function(selector) {
var selectorType = 'querySelectorAll';
if (selector.indexOf('#') === 0) {
selectorType = 'getElementById';
selector = selector.substr(1, selector.length);
}
var element = document[selectorType](selector);
@bbg
bbg / example.html
Last active January 21, 2020 22:32
jQuery upload image take the base64 code
<!DOCTYPE html>
<html>
<head>
<metea charset="utf8">
<title></title>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.0.0-alpha1/jquery.js"></script>
<script type="text/javascript">
function readURL(input) {
if (input.files && input.files[0]) {
var reader = new FileReader();
@bbg
bbg / preferences.sublime-settings
Created October 20, 2015 12:22
Sublime Text User Preferences
{
"caret_extra_bottom": 1,
"caret_extra_top": 1,
"caret_extra_width": 1,
"draw_minimap_border": true,
"font_size": 9,
"highlight_line": true,
"highlight_modified_tabs": true,
"line_padding_bottom": 2,
"line_padding_top": 2,
@bbg
bbg / box-shadow.html
Created August 27, 2015 12:50
CSS3 Box Shadow, only (top / right / bottom / left) and all
<!DOCTYPE html>
<html>
<head>
<title>Box Shadow</title>
<style>
.box {
height: 150px;
width: 300px;
margin: 20px;
border: 1px solid #ccc;
@bbg
bbg / example.js
Last active October 27, 2015 13:47
Detecting Mobile Devices with JavaScript
// To check to see if the user is on any of the supported mobile devices:
if (isMobile.any()) { alert('Mobile'); }
// To check to see if the user is on a specific mobile device:
if (isMobile.iOS()) { alert('iOS'); }