Skip to content

Instantly share code, notes, and snippets.

View orhanveli's full-sized avatar

orhan orhanveli

  • Finbyte GmbH
  • Turkiye
  • 04:24 (UTC +03:00)
View GitHub Profile
@orhanveli
orhanveli / namesub.py
Last active October 13, 2018 06:27 — forked from jasalt/namesub.py
rename subtitle files to match video files in same folder
'''
Rename subtitle files in same folder to match the movie file
(for xbmc-share folder)
Jarkko Saltiola 2013
'''
import os
import re
video_types = ["mkv","avi"]
@orhanveli
orhanveli / wp.sh
Last active December 5, 2017 03:52 — forked from bgallagh3r/wp.sh
Wordpress: Bash Install Script -- Downloads latest WP version, updates wp-config with user supplied DB name, username and password, creates and CHMOD's uploads dir, copies all the files into the root dir you run the script from, then deletes itself!
#!/bin/bash -e
clear
echo "============================================"
echo "WordPress Install Script"
echo "============================================"
echo "Database Name: "
read -e dbname
echo "Database User: "
read -e dbuser
echo "Database Password: "
@orhanveli
orhanveli / _vars-social-colors.scss
Last active September 21, 2015 20:06 — forked from koycarraway/_vars-social-colors.scss
Sass color variables for popular brands and social media.
// Social Colors
// ====================================================================
$color-facebook : hsla(222, 47%, 40%, 1); // #365397
$color-twitter : hsla(198, 100%, 47%, 1); // #00a9f1
$color-linkedin : hsla(203, 100%, 35%, 1); // #006db3
$color-apple : hsla(0, 0%, 45%, 1); // #737373
$color-google : hsla(217, 89%, 61%, 1); // #4285f4
/*
Türkiye İl ve İlçelerin enlem boylam bilgileri (dörtgen olarak sınır pozisyonlarıyla birlikte) kaynak : google maps (başarsoft)
twitter : http://twitter.com/tserpico
*/
DROP TABLE IF EXISTS `pk_il`;
CREATE TABLE `pk_il` (
`il_id` int(2) NOT NULL COMMENT 'plaka kodu',
`il_adi` varchar(255) NOT NULL,
`lat` double(20,8) DEFAULT NULL COMMENT 'enlem',
CREATE TABLE `vergi_daireleri` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`plaka` varchar(3) COLLATE utf8_unicode_ci DEFAULT NULL,
`il` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
`ilce` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
`daire` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
INSERT INTO vergi_daireleri (id, plaka, il, ilce, daire) VALUES (1, '01', 'ADANA', 'Merkez', '5 Ocak Vergi Dairesi Müdürlüğü');
@orhanveli
orhanveli / ToDynamic.cs
Last active October 17, 2017 19:15 — forked from demircimurat/gist:0f4cbc23b7a168f16c84
Object or Array to Dynamic in C#
public static class Extensions
{
public static dynamic ToDynamic(this object value)
{
if (value.IsListOrArray ()) {
var list = new List<ExpandoObject> ();
IEnumerable enumerable = value as IEnumerable;
foreach (object o in enumerable) {
list.Add (o.ToDynamic ());
// for demo: http://jsbin.com/jeqesisa/7/edit
// for detailed comments, see my SO answer here http://stackoverflow.com/questions/8853396/logical-operator-in-a-handlebars-js-if-conditional/21915381#21915381
/* a helper to execute an IF statement with any expression
USAGE:
-- Yes you NEED to properly escape the string literals, or just alternate single and double quotes
-- to access any global function or property you should use window.functionName() instead of just functionName()
-- this example assumes you passed this context to your handlebars template( {name: 'Sam', age: '20' } ), notice age is a string, just for so I can demo parseInt later
<p>
{{#xif " this.name == 'Sam' && this.age === '12' " }}
@orhanveli
orhanveli / css_resources.md
Last active August 29, 2015 14:07 — forked from jookyboi/css_resources.md
CSS libraries and guides to bring some order to the chaos.

Libraries

  • 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
  • Compass - Open source CSS Authoring Framework.
  • Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
  • Font Awesome - The iconic font designed for Bootstrap.
  • Zurb Foundation - Framework for writing responsive web sites.
  • SASS - CSS extension language which allows variables, mixins and rules nesting.
  • Skeleton - Boilerplate for responsive, mobile-friendly development.

Guides

@orhanveli
orhanveli / javascript_resources.md
Last active August 29, 2015 14:07 — forked from jookyboi/javascript_resources.md
Here are a set of libraries, plugins and guides which may be useful to your Javascript coding.

Libraries

  • jQuery - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
  • Backbone - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
  • AngularJS - Conventions based MVC framework for HTML5 apps.
  • Underscore - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
  • lawnchair - Key/value store adapter for indexdb, localStorage
@orhanveli
orhanveli / 0_reuse_code.js
Last active August 29, 2015 14:07
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console