Skip to content

Instantly share code, notes, and snippets.

@caneruguz
caneruguz / keybase.md
Created May 25, 2017 15:16
keybase.md

Keybase proof

I hereby claim:

  • I am caneruguz on github.
  • I am caneruguz (https://keybase.io/caneruguz) on keybase.
  • I have a public key ASCHBsWrmOol3NsX99Su0LyWGXm-EBUZ5-tC8EXJ_a3rkQo

To claim this, I am signing this object:

@caneruguz
caneruguz / qToggle.js
Created August 21, 2015 18:25
Quick Toggle plugin for jQuery
/**
* Quick toggle plugin to toggle visibility of elements within the page by defining a trigger and a target
*
* Usage:
* $(document).ready(function(){
* $('.my-item').qToggle({'animation' : 'fade', animationOptions : { duration : 200 }});
* });
*/
// Create the defaults once
@caneruguz
caneruguz / media_queries.css
Last active August 29, 2015 14:27 — forked from staydecent/media_queries.css
Example of various media queries for responsive web design.
/* Media queries used on blog.staydecent.ca by Adrian Unger
check my full source at:
http://blog.staydecent.ca/static/css/style-0.1.6.css */
@media only screen and (min-width:768px) and (max-width:1269px) {
/* In my particular design, I used a fluid grid limited to a
max-width of 1140px, while (if there is enough room)
pushing the menu outside of layout, requiring a total
limit of at least 1270px.
So, this first query applies to any screen-width less
@caneruguz
caneruguz / snippet.js
Created July 1, 2015 13:13
New design for the revisions table as cards
self.makeTableRow = function(revision, index) {
var isSelected = index === model.selectedRevision;
return m('.m-b-md.p-md.osf-box' + (isSelected ? '.osf-box-lt' : ''), [
m('.version-top.clearfix.m-b-sm', [
m('span', { style : 'font-size: 18px' }, isSelected ?
revision.displayVersion :
m('a', {href: revision.osfViewUrl}, revision.displayVersion)
),
m('.pull-right',
@caneruguz
caneruguz / multiRound.js
Last active August 29, 2015 14:16
Rounding multiple times while not losing remainders in Javascript
/*
* Return the rounded number and the new remainder using past remainder.
*
* @param {number} number The number that needs to be rounded
* @param {number} priorRemainder The remainder that is left over from last time that needs to be added to the calculation
*/
function multiRound(number, priorRemainder) {
var floored = Math.floor(number + priorRemainder);
var difference = (number + priorRemainder) - floored;
return {
  • set up sauce labs/browserstack account (remote tests)
  • download selenium server (not selenium IDE) & install Java (for local tests)
  • install phantomjs (brew install phantomjs) (probably doesn't work with intern-geezer)
  • to structure a directory: git clone https://github.com/theintern/intern-tutorial
    • we don't care about the application, so you can
      • rm -r app
      • rm index.html
  • step through steps 1 and 2 of the intern tutorial
    • but! don't install the main intern package on npm. you'll use npm install intern-geezer --save-dev. the geezer branch is capable of driving
    • you also don't need to worry about changing the packages attribute in loader (that's for dealing with the local app)
@caneruguz
caneruguz / data.json
Created September 4, 2014 14:23
Mithril jquery ui redrawing issue
[
{
"id" : 0,
"title" : "Dashboard",
"color" : "navy",
"minimize" : false,
"exposeWidth" : 300,
"exposeHeight" : 300,
"css" : "dashboard ht-module-inverted",
"columns" :[