Skip to content

Instantly share code, notes, and snippets.

View IbnSaeed's full-sized avatar

Ibn Saeed IbnSaeed

View GitHub Profile
@tamzinblake
tamzinblake / regex_end_of_string.md
Created May 27, 2011 15:37
Javascript regex grammar quirk

This gist regards some confusion resulting from this StackOverflow question.

Refer to sections 15.5.4.10 and 15.5.4.11 of the spec - page 145ish.

Before any passes, the cursor is at the start of the string:

, " , f , o , o ,   , b , a , r , " ,
^

lastIndex = 0
@IbnSaeed
IbnSaeed / Rounded Corners
Created May 31, 2011 09:52
CSS Rounded Corners
.round_corners {
margin-right: 10px;
padding: 10px;
width: 80px;
-moz-border-radius: 35px;
-khtml-border-radius: 35px;
-webkit-border-radius: 35px;
behavior: url('border-radius.htc');/* override for Microsoft Internet Explorer browsers*/
border-radius: 35px;/* override for Microsoft Internet Explorer browsers*/
border: 4px solid #grey;
@tmm1
tmm1 / elitedesktop.md
Created April 9, 2012 08:00
How to pimp your linux

THIS ASSUMES YOU RUN DEBIAN (or ubuntu, mint) AND ARE NOT A SUCKA MC

XDM

sudo aptitude install xdm
sudo echo '/usr/bin/xdm' > /etc/X11/default-display-manager

spectrwm, dmenu

sudo aptitude install dmenu libxtst-dev
git clone git://opensource.conformal.com/spectrwm.git
cd spectrwm/linux

@mrinalwadhwa
mrinalwadhwa / data_url.rb
Created June 20, 2012 04:00
SCSS custom function to insert data uri into style sheets.
require 'base64'
# tools.ietf.org/html/rfc2397
# developer.mozilla.org/en/data_URIs
# "data:" + MIME type + ";base64," + base64-encoded content
def to_data_url(content, content_type)
outuri = 'data:' + content_type + ';base64'
content = Base64.encode64(content).gsub("\n", '')
outuri += ",#{content}"
@kosmikko
kosmikko / gist:3083602
Created July 10, 2012 14:24
Makefile for compiling frontend assets
# build output dirs
BUILD_DIR = build
JS_BUILD_DIR = $(BUILD_DIR)/js
CSS_BUILD_DIR = $(BUILD_DIR)/css
IMG_BUILD_DIR = $(BUILD_DIR)/img
VENDOR_BUILD_DIR = $(BUILD_DIR)/vendor
TESTS_BUILD_DIR = test/build
# sources
TEMPLATES = $(shell find app -name '*.hbs')
@demoive
demoive / slugify.js
Last active February 9, 2025 17:17
Converts a string to a "URL-safe" slug
/**
* Converts a string to a "URL-safe" slug.
* Allows for some customization with two optional parameters:
*
* @param {string} Delimiter used. If not specified, defaults to a dash "-"
* @param {array} Adds to the list of non-alphanumeric characters which
* will be converted to the delimiter. The default list includes:
* ['–', '—', '―', '~', '\\', '/', '|', '+', '\'', '‘', '’', ' ']
*/
if (!String.prototype.slugify) {
@dmouse
dmouse / drupal_redis_settings.php
Last active December 16, 2015 12:08
Configuration Drupal 7 + Redis + Predis.
<?php
// ...
define('PREDIS_BASE_PATH', DRUPAL_ROOT . '/sites/all/libraries/predis/lib/');
$conf['redis_client_interface'] = 'Predis';
$conf['cache_backends'][] = 'sites/all/modules/redis/redis.autoload.inc';
@odony
odony / .fonts.conf
Last active May 10, 2021 07:54 — forked from silv3rm00n/.fonts.conf
Updated version of the fonts.conf file mentioned in http://www.binarytides.com/gorgeous-looking-fonts-ubuntu-linux/ in order to get rid of most of the fontconfig warnings (mostly the "Having multiple values in <test> isn't supported and may not work as expected")
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<!--
Documented at
http://linux.die.net/man/5/fonts-conf
To check font mapping run the command at terminal
$ fc-match 'helvetica Neue'
@mbrochh
mbrochh / install_venv.sh
Created February 5, 2014 15:32
Installing virtualenvwrapper on Webfaction
#!/bin/bash
PYTHONVER=2.7
PYTHON=python${PYTHONVER}
mkdir -p $HOME/{bin,tmp,lib/$PYTHON}
easy_install-${PYTHONVER} pip
pip2.7 install virtualenv --no-use-wheel
pip2.7 install --install-option="--user" virtualenvwrapper --no-use-wheel
# Update $HOME/.bashrc with appropriate environment variables
echo 'export PATH="$HOME/bin:$PATH"' >> $HOME/.bashrc
@mlouro
mlouro / gulpfile.js
Last active April 12, 2025 09:11
gulpfile.js with browserify, jshint, libsass, browserSync for livereload, image optimization and system notifications on errors
'use strict';
var gulp = require('gulp');
var gutil = require('gulp-util');
var del = require('del');
var uglify = require('gulp-uglify');
var gulpif = require('gulp-if');
var exec = require('child_process').exec;
var notify = require('gulp-notify');