Skip to content

Instantly share code, notes, and snippets.

View fatihacet's full-sized avatar
🤙

Fatih Acet fatihacet

🤙
View GitHub Profile
@fatihacet
fatihacet / gist:4000605
Created November 2, 2012 11:43
Divide string into parts
var arr = "123456789012341".match(/.{3,4}/g);
console.log(arr); // ["1234", "5678", "9012", "341"]
@fatihacet
fatihacet / numberPaste.js
Created November 15, 2012 08:54
Allow pasting only numbers
$('#securityCode').bind('paste', function() {
var el = this;
setTimeout(function() {
el.value = el.value.replace(/\D/g, '');
}, 0);
});
@fatihacet
fatihacet / ie-virtual-machines.txt
Created November 20, 2012 00:47
Windows Virtual PC VHDs for testing websites with different Internet Explorer versions
http://www.microsoft.com/en-us/download/details.aspx?id=11575
@fatihacet
fatihacet / sample.json
Created December 9, 2012 23:32
Sample array of object json
[
{
"id": 1,
"body": "First Item",
"severity": 1,
"status": 0
},
{
"id": 2,
"body": "Second Item",
@fatihacet
fatihacet / just-number.js
Last active December 10, 2015 00:48
get only numbers in a string with regex
var k = '3dsaAdas2dAAASdasdasDŞ321ĞİÜEQWEWQ098"**?_Ü;SDA!22';
k.replace(/\D/g, '');
@fatihacet
fatihacet / flipcounterview.coffee
Last active August 29, 2015 13:55 — forked from burakcan/Coffee
FlipCounterView
class FlipCounterView extends KDView
constructor : (options = {}, data = {}) ->
options.style ?= "dark"
options.from ?= 5000
options.to ?= 10000
options.interval ?= 1000
options.step ?= 1
options.autoStart ?= yes
options.direction = if options.from < options.to then "up" else "down"
options.digits ?= if options.direction is "up" then options.to.toString().length else options.from.toString().length
@fatihacet
fatihacet / preferences.sublime-settings
Last active August 29, 2015 13:57
My Sublime Text 3 config
{
"color_scheme": "Packages/Colorsublime-Themes/deep_blue_see.tmTheme",
"enable_tab_scrolling": false,
"env": {
"PATH": "/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/share/npm/bin/"
},
"folder_exclude_patterns": [
".svn",
".git",
".hg",

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@fatihacet
fatihacet / diff.coffee
Created March 22, 2014 09:16
diff arrays
console.clear()
diff = (a, b) ->
deleted = []
added = []
# deleted.push item for item in a when b.indexOf(item) is -1
# added.push item for item in b when a.indexOf(item) is -1
clone = b.slice 0
@fatihacet
fatihacet / main.coffee
Created March 26, 2014 19:30
Coffee2JS.kdapp
class CoffeetojsMainView extends KDView
constructor: (options = {}, data) ->
super options, data
@loading = new KDLoaderView
size :
width : 48
showLoader : yes