Skip to content

Instantly share code, notes, and snippets.

View jcubic's full-sized avatar
🎯
Focusing

Jakub T. Jankiewicz jcubic

🎯
Focusing
View GitHub Profile
@jcubic
jcubic / dabblet.css
Created January 29, 2014 19:01
CSS3 Pagniation
body {
background: #222;
}
.arrow {
background-color: white;
transform: rotate(45deg);
position: absolute;
top: 50%;
}
.arrow, .arrow:before {
@jcubic
jcubic / foo.js
Created March 14, 2014 08:24
indent test file for web-mode
(function() {
// }
function() { //
foo();
bar();
}
baz();
})();
@jcubic
jcubic / keybase.md
Created August 15, 2014 07:56
Kebase.io proof

Keybase proof

I hereby claim:

  • I am jcubic on github.
  • I am jcubic (https://keybase.io/jcubic) on keybase.
  • I have a public key whose fingerprint is BC65 3F92 314B 398B 5E1E 0BC7 A58E E6F1 31F8 3013

To claim this, I am signing this object:

@jcubic
jcubic / browser.js
Last active August 29, 2015 14:05
MVVM demo with route.js, jsViews, jQuery and hashchange
(function() {
var matched, browser;
// Use of jQuery.browser is frowned upon.
// More details: http://api.jquery.com/jQuery.browser
// jQuery.uaMatch maintained for back-compat
jQuery.uaMatch = function( ua ) {
ua = ua.toLowerCase();
@jcubic
jcubic / javascript query string
Last active October 6, 2015 13:58
create an object from query string
var query = (function() {
function decode(string) {
return decodeURIComponent(string.replace(/\+/g, " "));
}
var result = {};
if (location.search) {
location.search.substring(1).split('&').forEach(function(pair) {
pair = pair.split('=');
result[decode(pair[0])] = decode(pair[1]);
});
@jcubic
jcubic / jquery hackerrank bot
Created July 2, 2012 21:12
Bot that hack hackerrank interface to solve game
(function() {
function enter(element, string) {
var prompt = $(element);
var press = jQuery.Event("keydown");
press.which = 13;
press.keyCode = 13;
prompt.val(string).trigger(press);
}
function move(count) { // number of moves
@jcubic
jcubic / gist:3113708
Created July 14, 2012 22:32
Javascript bot that solve 2 challange on Hacker Rank
(function() {
function DoCaeserEncrypt(x,shf){
var abc="abcdefghijklmnopqrstuvwxyz";
var ABC="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
var r1="";
var r2="";
var shf=eval(shf);
for(i=0;i < x.length;i++){let=x.charAt(i);pos=ABC.indexOf(let);if(pos >=0){r1+=ABC.charAt( (pos+shf)%26 )}else{r1+=let};};
for(i=0;i < r1.length;i++){let=r1.charAt(i);pos=abc.indexOf(let);if(pos >=0){r2+=abc.charAt( (pos+shf)%26 )}else{r2+=let};};
return r2;
@jcubic
jcubic / gist:3113713
Created July 14, 2012 22:35
Candy Game challage on Hacker Rank
(function(start) {
function send(method, data, fun) {
$.ajax({
type: method,
url: '/splash/challenge.json',
dataType: 'json',
data: data,
success: fun
});
}
@jcubic
jcubic / gist:3162477
Created July 23, 2012 07:55
breaking forEach loop in javascript
(function(continuation) {
[1,2,3,4].forEach(function(e, i) {
if (e == 2) {
continuation();
}
});
})(function() {
// rest of the code
});
@jcubic
jcubic / gist:3194755
Created July 28, 2012 20:55
Javascript obfuscation challange
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('1Q(1m(1m("1Q(3B(p%3k%3g%1u%3c%3b)%39%1J(c)%1k(c%35%2V\'\'%2U(2T(c%2P)))%1h((c%2L%2K)%2J%2I.2H(c%2G)%2F.2E(36))%S%2D(!\'\'.1w(%1y%2C%1y%2A))%2y(c--)r%1F(c)%Q%2x%1c%Q%W%2v(c)%2t%2s%2r(e)%1k%2p%1F%Q%S%Q%2n%1J()%1k\'%1b%2j%1h\'%S%2i%2g%S%2f(c--)2e(k%1c%Q)p%2d.1w(2c%2b(\'%1b%1x\'%2a(c)%1h\'%1b%1x\'%19\'g\')%1u%1c%Q)%29%28%S(\'1L(13(13(13(%27%24%1l%23%f%J%u%l%A%2%7%0%22%0%n%0%w%0%1p%0%y%0%x%7%4%7%0%1t%0%w%0%16%0%n%0%21%0%20%0%1j%7%4%7%0%x%0%m%0%n%0%1j%7%4%7%0%y%0%M%0%8%j%0%M%0%11%0%n%0%m%0%1Z%0%1E%0%N%0%n%7%4%7%0%O%0%N%0%n%0%m%0%8%F%0%1p%0%n%0%w%0%y%7%4%7%0%x%0%y%0%y%0%s%0%8%z%0%10%0%10%0%T%0%14%0%1O%0%Y%0%14%0%1Y%0%Y%0%14%0%1X%0%14%0%Y%0%14%0%1W%0%1O%0%10%0%48%0%T%7%4%7%0%x%0%y%0%y%0%s%7%4%7%0%