Skip to content

Instantly share code, notes, and snippets.

View AttilaSATAN's full-sized avatar
🏠
Working from home

Attila Satan AttilaSATAN

🏠
Working from home
  • LTVPlus
  • Ankara, Turkey, Earth, Sol, Milkyway
View GitHub Profile
# Change YOUR_TOKEN to your prerender token and uncomment that line if you want to cache urls and view crawl stats
# Change example.com (server_name and in the rewrite rule) to your website url
# Change /path/to/your/root to the correct value
server {
listen 80;
server_name example.com;
root /path/to/your/root;
index index.html;
@AttilaSATAN
AttilaSATAN / slugify.service.js
Last active October 22, 2018 14:39
Angularjs için türkçe slugify servisi.
angular.module('app.utils.services', []).
factory('slugify', function () {
return function(text){
if (!text) return null;
var trMap = {
'çÇ': 'c',
'ğĞ': 'g',
'şŞ': 's',
'üÜ': 'u',
'ıİ': 'i',
@AttilaSATAN
AttilaSATAN / gist:837c7184a8d7044662d7
Created July 15, 2014 12:41
ATOM installation problem on runas package windows (8.1)
# install visual studio 2013 express
# install python 2.7
# on powershell
$env:PYTHON = "C:\Path\to\Python27\python.exe"
$env:GYP_MSVS_VERSION = 2013
script/bootstrap
@AttilaSATAN
AttilaSATAN / gist:5c54b45da76794d636c9
Last active August 29, 2015 14:03
bson package problem on ubuntu (Failed to load c++ bson extension, using pure JS version)
//
// check the builderror.log file for error (mongoose/node_modules/mongodb/node_modules/bson/builderror.log)
// it should be about a parameter problem of node-gyp (invalid options vs.vs.)
// just erease the main node_module directory and
sudo npm update -g node-gyp
// now install packages
npm install
@AttilaSATAN
AttilaSATAN / designer.html
Last active August 29, 2015 14:07
designer
<link rel="import" href="../core-menu/core-submenu.html">
<link rel="import" href="../core-item/core-item.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: static;
width: 100%;
@AttilaSATAN
AttilaSATAN / designer.html
Last active August 29, 2015 14:07
designer
<link rel="import" href="../topeka-elements/category-images.html">
<link rel="import" href="../core-icon/core-icon.html">
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../core-icons/av-icons.html">
<link rel="import" href="../paper-fab/paper-fab.html">
<link rel="import" href="../google-map/google-map.html">
<polymer-element name="my-element">
<template>
'use strict';
var gulp = require( 'gulp' ),
gutil = require( 'gulp-util' ),
fork = require( 'child_process' ).fork,
tinyLr = require( 'tiny-lr' ),
async = require( 'async' );
var dirs = {
app: [
@AttilaSATAN
AttilaSATAN / LINKS.md
Last active August 29, 2015 14:09
NodeJS ES6 (Harmony) Articals & Examples
@AttilaSATAN
AttilaSATAN / README.md
Created November 19, 2014 12:54
python version switch

For me it got fixed by replacing python2.7 by python2.6. As per https://code.google.com/p/gyp/source/browse/trunk/DEPS#19 , it seems that gyp depends on python 2.6

On Ubuntu Saucy:

sudo add-apt-repository ppa:fkrull/deadsnakes
sudo apt-get update
sudo apt-get install python2.6
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.6 20
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.7 10
@AttilaSATAN
AttilaSATAN / server.js
Created November 27, 2014 09:03
CORS headers
// // Website you wish to allow to connect
// res.setHeader('Access-Control-Allow-Origin', 'http://localhost:3005');
//
// // Request methods you wish to allow
// res.setHeader('Access-Control-Allow-Methods', 'GET, POST, OPTIONS, DELETE');
//
// // Request headers you wish to allow
// res.setHeader('Access-Control-Allow-Headers', 'X-Requested-With,content-type,Authorization');
//
// // Set to true if you need the website to include cookies in the requests sent