Skip to content

Instantly share code, notes, and snippets.

View mucit's full-sized avatar
🎯
Focusing

mucit mucit

🎯
Focusing
View GitHub Profile
@mucit
mucit / existing code to git repo
Last active January 21, 2018 21:02 — forked from zenideas/existing code to git repo
Adding existing source to remote git repo
If you've got local source code you want to add to a new remote new git repository without 'cloning' the remote first, do the following (I often do this - you create your remote empty repository in bitbucket/github, then push up your source)
1. Create the remote repository, and get the URL such as git://github.com/youruser/somename.git
2. If your local GIT repo is already set up, skips steps 2 and 3
3. Locally, at the root directory of your source, git init
4. Locally, add and commit what you want in your initial repo (for everything,
git add .
@mucit
mucit / script.sh
Created October 11, 2017 11:38 — forked from pulkitsinghal/script.sh
Auto Increment Version Script
# Auto Increment Version Script
buildPlist=${INFOPLIST_FILE}
CFBuildNumber=$(/usr/libexec/PlistBuddy -c "Print CFBuildNumber" $buildPlist)
CFBuildNumber=$(($CFBuildNumber + 1))
/usr/libexec/PlistBuddy -c "Set :CFBuildNumber $CFBuildNumber" $buildPlist
CFBuildDate=$(date)
/usr/libexec/PlistBuddy -c "Set :CFBuildDate $CFBuildDate" $buildPlist
@mucit
mucit / boxstarter.ps1
Created September 24, 2017 18:14 — forked from jessfraz/boxstarter.ps1
Boxstarter Commands for a new Windows box.
# Description: Boxstarter Script
# Author: Jess Frazelle <[email protected]>
# Last Updated: 2017-09-11
#
# Install boxstarter:
# . { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force
#
# You might need to set: Set-ExecutionPolicy RemoteSigned
#
# Run this boxstarter by calling the following from an **elevated** command-prompt:
@mucit
mucit / tranlock.sql
Created May 22, 2017 17:28
sql tran lock query
select cmd, substring(loginame,1,20), substring(program_name, 1,20) , *
from master..sysprocesses
where open_tran>0
order by 1
/* bu ikinci */
--dbcc inputbuffer (105)
using Dapper;
using Oracle.ManagedDataAccess.Client;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
public class OracleDynamicParameters : Dapper.SqlMapper.IDynamicParameters {
private static Dictionary<SqlMapper.Identity, Action<IDbCommand, object>> paramReaderCache = new Dictionary<SqlMapper.Identity, Action<IDbCommand, object>>( );
@mucit
mucit / __init__.py
Last active August 18, 2016 15:13
opensubtitles plugin init_py (turkish encoding fix applied)
# opensubtitles.org
# Subtitles service allowed by www.OpenSubtitles.org
# Language codes: http://www.opensubtitles.org/addons/export_languages.php
import difflib
OS_API = 'http://plexapp.api.opensubtitles.org/xml-rpc'
OS_PLEX_USERAGENT = 'plexapp.com v9.0'
SUBTITLE_EXT = ['utf','utf8','utf-8','sub','srt','smi','rt','ssa','aqt','jss','ass','idx']
@mucit
mucit / hack.sh
Created September 7, 2012 20:20 — forked from ahmetb/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@mucit
mucit / gist:1236899
Created September 23, 2011 07:29 — forked from neoGeneva/gist:1234779
Detect Encoding in C#
public static Encoding GetFileEncoding(string path)
{
if (path == null)
throw new ArgumentNullException("path");
var encodings = Encoding.GetEncodings()
.Select(e => e.GetEncoding())
.Select(e => new { Encoding = e, Preamble = e.GetPreamble() })
.Where(e => e.Preamble.Any())
.ToArray();