Skip to content

Instantly share code, notes, and snippets.

View Netcelal's full-sized avatar

Celal Basar Netcelal

View GitHub Profile
var http = require("http"),
url = require("url"),
path = require("path"),
fs = require("fs")
port = process.argv[2] || 8888;
http.createServer(function(request, response) {
var uri = url.parse(request.url).pathname
, filename = path.join(process.cwd(), uri);
@Netcelal
Netcelal / gist:3296673
Created August 8, 2012 17:03 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@Netcelal
Netcelal / Boxfile.yml
Created July 30, 2012 23:38 — forked from Meroje-snippets/Boxfile.yml
Boxfile:Laravel
global:
env:
- LARAVEL_ENV: production
web1:
name: your-app-name
shared_writable_dirs:
- /storage/cache
- /storage/database
- /storage/logs
- /storage/sessions
@Netcelal
Netcelal / mixins.scss
Created July 25, 2012 20:44 — forked from jpmckinney/mixins.scss
CSS3 SCSS Mixins
// blog post: http://blog.slashpoundbang.com/post/15096433153/css3-scss-mixins
// Mixins ----------------------------------------------------------------------
// http://css3please.com/
@mixin background-rgba($red, $green, $blue, $opacity, $rgba) {
background-color: transparent;
background-color: rgba($red, $green, $blue, $opacity);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{$rgba}',endColorstr='#{$rgba}');
zoom: 1;
}
@Netcelal
Netcelal / _mixins.scss
Created July 25, 2012 19:26 — forked from garyharan/_mixins.scss
Useful scss mixins (rounded corners, gradients, text-field, button)
@mixin box-shadow($top, $left, $blur, $color, $inset: false) {
@if $inset {
-webkit-box-shadow:inset $top $left $blur $color;
-moz-box-shadow:inset $top $left $blur $color;
box-shadow:inset $top $left $blur $color;
} @else {
-webkit-box-shadow: $top $left $blur $color;
-moz-box-shadow: $top $left $blur $color;
box-shadow: $top $left $blur $color;
}
@Netcelal
Netcelal / sass_and_less_compared.markdown
Created July 24, 2012 07:57 — forked from wilmoore/sass_and_less_compared.markdown
Sass/Less Comparison (updated 2011-02-09) -- thanks to chriseppstein for starting this

Sass/Less Comparison

In this document I am using Sass's SCSS syntax. You can choose to use the indented syntax in sass, if you prefer it, it has no functional differences from the SCSS syntax.

For less, I'm using the ruby version because this is what they suggest on the website. The javascript version may be different.

Variables

@Netcelal
Netcelal / gist:2939360
Created June 16, 2012 00:31 — forked from thehydroimpulse/gist:2872907
A Laravel task generator. Models, Migrations and Controllers.
<?php
/**
* @copyright 2012 TheHydroImpulse, Daniel Fagnan
* @version 0.1
* @todo Add an overwite ability. Among other things.
* @note Use this as you wish. Extend it, Mash it. Enjoy it.
*/
@Netcelal
Netcelal / gist:2816412
Created May 27, 2012 23:42 — forked from mikemorris/gist:2654086
PHP script to scrape links from HTML files
<?php
$links = shell_exec('egrep -o -r "<a[^<]+?(\w*)</a>" --include=*.html *');
$output;
foreach(preg_split("/(\r?\n)/", $links) as $line){
$file = explode(':', $line)[0];
preg_match('/(?<=href=")[^"]+?(?=")/', $line, $url_matches);
$url = $url_matches[0];
@Netcelal
Netcelal / index.html
Created May 26, 2012 15:10 — forked from dennisschipper/index.html
Html5 starter kit
<!doctype html>
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" href="styles.css">
<!--[if lt IE 9]><script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
</head>
<body>
<div id="wrapper">
@Netcelal
Netcelal / gist:2794267
Created May 26, 2012 15:08 — forked from paulirish/gist:366184
html5 geolocation with fallback.
// geo-location shim
// currentely only serves lat/long
// depends on jQuery
;(function(geolocation){
if (geolocation) return;
var cache;