Skip to content

Instantly share code, notes, and snippets.

View fatihacet's full-sized avatar
🤙

Fatih Acet fatihacet

🤙
View GitHub Profile
@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 / input.scss
Last active August 8, 2016 21:55
Use Scss map and map_get to get dynamic variables from map.
$white_foo_bar: #FFF;
$map: (
foo: 'foo',
bar: 'bar',
baz: 'white',
foowhite: 'foowhitecolor'
);
@mixin foo($type) {
@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 / 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 / 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 / fire-rainbow.css
Created October 22, 2012 07:00
Color scheme for fire rainbow addon.
.panelNode-script { background-color: #EFEFE7; color: black; cursor: default; font-family: Monaco,Monospace,Courier New !important; font-size: 12px; }
.sourceRow.hovered { background-color: #EEEEEE; }
.sourceLine { background: none no-repeat scroll 2px 0 #EEEEEE; border-bottom: 1px solid #EEEEEE; border-right: 1px solid #CCCCCC; color: #888888; }
.sourceLine:hover { text-decoration: none; }
.scriptTooltip { background: none repeat scroll 0 0 LightYellow; border: 1px solid #CBE087; color: #000000; }
.sourceRow[exeline="true"] { background-color: lightgoldenrodyellow; outline: 1px solid #D9D9B6; }
.js-comment { color: gray; font-size: 11px; }
.whitespace { color: blue; }
.js-variable { color: #7C3A99; font-size: 11px; }
.js-punctuation { color: black; font-size: 11px; }
@fatihacet
fatihacet / numberonly.js
Created October 3, 2012 14:06
number only field
numericField = function (elementId) {
var allowed = [0, 8];
for (var i = 48; i < 58; i++) {
allowed.push(i);
}
$("#" + elementId).keypress(function(e){
if (!(allowed.indexOf(e.which) >= 0)) {
e.preventDefault();
@fatihacet
fatihacet / entity-lookup.txt
Created September 13, 2012 12:44
HTML Entity Chars Lookup Page
http://llizard.etherwork.net/cwc/charactmap.html
@fatihacet
fatihacet / sticky-footer.html
Created September 5, 2012 13:21
sticky footer
@fatihacet
fatihacet / history.js
Created August 29, 2012 23:11
Implementing history navigate in Google Closure Library
var history = new goog.History(false, '', document.getElementById('history_input'));
goog.events.listen(history, goog.history.EventType.NAVIGATE, function() {
console.log(history.getToken());
});
history.setEnabled(true);