Skip to content

Instantly share code, notes, and snippets.

View StanAngeloff's full-sized avatar

Stan Angeloff StanAngeloff

View GitHub Profile
@StanAngeloff
StanAngeloff / Makefile
Created October 17, 2012 11:52
Get the product name, useful if you want to verify a piece of code is executed under VirtualBox.
SYSTEM_PRODUCT_NAME = $(shell cat /sys/devices/virtual/dmi/id/product_name 2>/dev/null )
@StanAngeloff
StanAngeloff / define.js
Created October 11, 2012 06:47
Dead simple AMD in a single file.
/**
* Define a module with optional dependencies.
*
* @function
* @param {String} id Optional module ID. If this is omitted, no module is defined and instead <code>factory</code> is called immediately.
* @param {Array} dependencies Optional list of module IDs on which this module depends.
* @param {Function} factory The module body. The function is called with arguments matching the given dependencies, if any.
* @return {Function} The module body with dependencies injected.
*/
var define = (function() {
// Taken from https://bitbucket.org/pellepim/jstimezonedetect/raw/default/detect_timezone.js
/*version 2012-05-10*/
/**
* Namespace to hold all the code for timezone detection.
*/
var jstz = (function () {
'use strict';
" Cyrillic configuration, tired of layout switching, no?
set langmap+=чявертъуиопшщасдфгхйклзьцжбнмЧЯВЕРТЪУИОПШЩАСДФГХЙКЛЗѝЦЖБНМ;`qwertyuiop[]asdfghjklzxcvbnm~QWERTYUIOP{}ASDFGHJKLZXCVBNM,ю\\,Ю\|,
@StanAngeloff
StanAngeloff / 10-buffers.scss
Created July 28, 2012 19:35
SASS buffers draft
// See https://github.com/nex3/sass/issues/116
$device-size: small;
$device-width: 640px;
body {
color: white;
@buffer #{$device-size}-screen {
color: black;
}
@StanAngeloff
StanAngeloff / config.rb
Created July 23, 2012 16:27
Draft PHP script to join @media queries in a CSS file.
# [..]
require 'shellwords'
on_stylesheet_saved do |filename|
script = File.dirname(__FILE__) + '/_scripts/join-media-queries.php'
system('php -q ' + Shellwords.escape(script) + ' -i ' + Shellwords.escape(filename))
end
@StanAngeloff
StanAngeloff / ext-inline.coffee
Created June 6, 2012 14:05
CoffeeScript `include ..` extension
fs = require 'fs'
path = require 'path'
CoffeeScript = require 'coffee-script'
CoffeeScript.on 'compile', (task) ->
task.input = task.input.replace /^([ \t]*)#=\s*include\s+(.*)$/im, (group, indent, file) ->
"#{indent}`#{ fs.readFileSync(path.join(path.dirname(task.file), file), 'utf8') }`"
@StanAngeloff
StanAngeloff / .messages.bg_BG.UTF-8
Created June 5, 2012 12:04
Глобул 3G + Sakis 3G за Lubuntu 12.04
##2
# If first line starts with "##" and has a single digit following it,
# it should denote average count of bytes used in representing UTF-8
# characters of this locale. This value is utilized into properly
# wrapping translated text.
#
# This is a translation file for Sakis3G All-in-one script.
#
# All translation files should strictly remain in UTF-8 encoding.
# Make sure your editor loads and saves file using UTF-8.
@StanAngeloff
StanAngeloff / _constants.scss
Created May 24, 2012 11:00
Sass/Compass theming
$theme:
page #fff
navigation (
background #f4f4f4
text #595959
)
;
$levels:
To start a multi-line comment:
<!-- {{=<% %>=}}<%!
to end a multi-line comment:
%><%={{ }}=%> -->
Sooo: