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 / 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'); }
@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 / 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 / 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 / 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 / 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 / css-calc.css
Created June 14, 2017 16:46 — forked from jonkemp/css-calc.css
Cross Browser CSS Calc()
/* 1. write it out for older browsers */
/* 2. use the vendor prefix for webkit */
/* 3. use the vendor prefix for moz */
/* 4. include the un-prefixed version last */
#foo {
width: 200px;
width: -webkit-calc(50% - 100px);
width: -moz-calc(50% - 100px);
width: calc(50% - 100px);
@bbg
bbg / nginx_w_lua.bash
Last active September 5, 2017 21:49
Nginx (Lua Module & Nginx Devel Kit & LuaJIT) install bash script
#!/bin/bash
cd /tmp
if ! test -d /usr/local/include/luajit-2.0; then
echo "Installing LuaJIT-2.0.1."
wget "http://luajit.org/download/LuaJIT-2.0.1.tar.gz"
tar -xzvf LuaJIT-2.0.1.tar.gz
cd LuaJIT-2.0.1
make
@bbg
bbg / atom-vertical-file-tabs.less
Created September 23, 2017 10:16 — forked from jasesmith/atom-vertical-file-tabs.less
For vertically stacked open file tabs, put this in your `./atom/styles.less`
atom-workspace-axis.vertical atom-pane {
flex-direction: row;
.tab-bar {
box-shadow: inset -1px 0 0 #181a1f;
resize: horizontal;
height: auto;
display: block;
padding-right: 1px;
padding-bottom: 3em;
min-width: 14em;
@bbg
bbg / index.html
Created September 29, 2017 11:48 — forked from arisetyo/index.html
Dynamic Real-time Chart Using Chart.js, Socket.io, and Knockout.js
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="author" content="Galenic">
<script src="js/jquery-1.9.1.js"></script>
<script src="js/knockout-2.1.0.js"></script>
<script src="js/Chart.js"></script>
<link rel="stylesheet" href="pure-min.css">