Skip to content

Instantly share code, notes, and snippets.

View svilenkov's full-sized avatar

Igor svilenkov

  • 0XFEEDFACF
  • Serbia
View GitHub Profile
#!/bin/bash
# --- Version history ---
# 0.4: added variable to store file path, and $2 for base file name
# added variable to store desired reporting interval
# 0.3: added $1 to send in process ID at run time.
# 0.2: switched to $SECONDS for the loop. works.
# 0.1: didn't work well at all.
# --- Version history ---
# Usage: cputrack [PID] [filename]

Sass/Less Comparison

In this document I am using Sass's SCSS syntax. You can choose to use the indented syntax in sass, if you prefer it, it has no functional differences from the SCSS syntax.

For Less, I'm using the JavaScript version because this is what they suggest on the website. The ruby version may be different.

Variables

@mythz
mythz / xhr.js
Created November 2, 2011 19:05
Standalone jQuery-like Ajax Client
//Adds $.xhr and jQuery-like $.ajax methods to the prescribed namespace.
//Inspired from David Flanagans excellent cross-platform utils http://www.davidflanagan.com/javascript5/display.php?n=20-1&f=20/01.js
//Includes underscore.js _.each and _.extend methods
//modified to behave like jQuery's $.ajax(), not complete.
(function($) {
var win=window, xhrs = [
function () { return new XMLHttpRequest(); },
function () { return new ActiveXObject("Microsoft.XMLHTTP"); },
function () { return new ActiveXObject("MSXML2.XMLHTTP.3.0"); },
function () { return new ActiveXObject("MSXML2.XMLHTTP"); }
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 22, 2024 04:43
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@samdark
samdark / taggable_or.php
Created October 3, 2012 09:36
Find by any of tags for taggable Yii extension
/**
* Get criteria to limit query to match any of tags specified
* @access private
* @param array $tags
* @return CDbCriteria
*/
protected function getFindByAnyTagsCriteria($tags) {
$criteria = new CDbCriteria();
$pk = $this->getOwner()->tableSchema->primaryKey;

Spree (vs. Magento)

  • Spree does not offer media management as a CMS function

This is true, but we do have some extensions such as spree_static_content that do provide the ability to create extra pages for your site.

  • One page checkout is available on Magento, but not Spree

Assuming you mean the fields are all on one page: This is not provided by default, but it is relatively easy to customize Spree to do this. It's pretty commonly requested, and so it might be a good idea for us to provide a guide on how to do this.

@JunichiIto
JunichiIto / alias_matchers.md
Last active May 14, 2024 08:48
List of alias matchers in RSpec 3

This list is based on aliases_spec.rb.

You can see also Module: RSpec::Matchers API.

matcher aliased to description
a_truthy_value be_truthy a truthy value
a_falsey_value be_falsey a falsey value
be_falsy be_falsey be falsy
a_falsy_value be_falsey a falsy value
@olgakogan
olgakogan / gmail_api.md
Last active December 14, 2022 11:53
Manually get OAuth credentials to access your gmail account via API

Basic setup

  1. Access the developer console https://console.developers.google.com
  2. Create a new project
  3. In APIs and Oauth section:
    a. In APIs section - enable gmail api
    b. In Credentials section -
    1. Click Create new client ID
    2. Fill email and project name
    3. Save
@oldfartdeveloper
oldfartdeveloper / elixirconf_notes.org
Created October 23, 2015 23:14
My Elixirconf 2015 Austin Notes

Advanced Phoenix Traiing

Organization

  • web only has code that has no state. Changes to these files auto- restarts the server.
  • lib functionality manages state. (Note: server does not auto-reload w/ changes to these.

What is above is a property of :reloadable_paths.

@arjones
arjones / notify-slack.sh
Last active September 9, 2023 22:20
Notify Slack - Send notifications to a Slack Channel - http://arjon.es/2016/09/15/be-notified-on-slack-when-a-long-process-finishes/
# Notify Slack - Send notifications to a Slack Channel
# Copyright (C) 2016 Gustavo Arjones (@arjones)
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# Full blog post here: http://arjon.es/2016/09/15/be-notified-on-slack-when-a-long-process-finishes/
#