Skip to content

Instantly share code, notes, and snippets.

Avatar

Rafal Pastuszak paprikka

View GitHub Profile
@paprikka
paprikka / ckeditor.coffee
Created Feb 20, 2013
CKEDITOR directive for angularJS + CoffeeScript
View ckeditor.coffee
angular.module('app.directives.ckeditor', [])
.directive 'ckeditor', ->
require: '?ngModel'
link: (scope, elm, attr, ngModel)->
ck = CKEDITOR.replace elm[0]
unless ngModel then return
ck.on 'pasteState', ->
scope.$apply ->
ngModel.$setViewValue ck.getData()
ngModel.$render = (value)-> ck.setData ngModel.$viewValue
View Preferences.sublime-settings
{
"binary_file_patterns":
[
"*.jpg",
"*.jpeg",
"*.png",
"*.gif",
"*.ttf",
"*.tga",
"*.dds",
@paprikka
paprikka / .bashrc
Created Oct 17, 2012
GIT bash config # don't forget to change paths to suit your working environment / OS
View .bashrc
alias ls="ls -a --color=always"
alias work="cd /d/Work"
alias ga="git add ."
alias gs="git status"
alias gc="git commit -a -m"
alias gp="git pull"
alias gpp="git push"
alias cw="compass watch"
alias edit="/c/Program\ Files/Sublime\ Text\ 2/sublime_text.exe"
alias explore="explorer "
@paprikka
paprikka / gist:3178258
Created Jul 25, 2012 — forked from paulirish/gist:366184
html5 geolocation with fallback.
View gist:3178258
// geo-location shim
// currentely only serves lat/long
// depends on jQuery
// doublecheck the ClientLocation results because it may returning null results
;(function(geolocation){
if (geolocation) return;
View _shadow-3d.scss
// usage text-shadow / box-shadow : shadow-3d($color, $length);
// adds pseudo-3d vertical shadow
@function shadow-3d($col, $h){
$str : "";
$shadow-col : darken($col, 5%);
@for $i from 1 through $h{
$str : "#{$str} 0 #{$i}px 0 #{$shadow-col},";
}
View detect caps lock.js
function checkCapslock (e) {
var $el = $(this),
hasLabel = $el.parent().find('.capslock-on-alert').length > 0 ? true : false;
var kc = e.keyCode?e.keyCode:e.which;
var sk = e.shiftKey?e.shiftKey:((kc == 16)?true:false);
var isCaps = ((kc >= 65 && kc <= 90) && !sk)||((kc >= 97 && kc <= 122) && sk);
if(isCaps && !hasLabel) {
View let.js
"use strict"
var a = 'foo';
function foo() {
console.log(a);
var a = 'bar';
console.log(a);
};
You can’t perform that action at this time.