Skip to content

Instantly share code, notes, and snippets.

View manuhabitela's full-sized avatar
🦆

Emmanuel Pelletier manuhabitela

🦆
View GitHub Profile

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

@Daniel15
Daniel15 / 1_Twitter autoresponder bot.md
Last active December 6, 2021 20:37
Twitter autoresponder bot

Twitter autoresponder bot

By Daniel15 (dan.cx) This is a very simple Twitter autoresponder bot. It requires PECL OAuth extension to be installed (run "pecl install oauth", or if on Windows, grab php-oauth.dll. If using cPanel you can install it via WHM). The authentication is designed for command-line usage, it won't work too well via a web browser. You'll have to sign up for an application on Twitter's site to get the consumer key and secret.

Could be modified to be more advanced (match regular expressions to answer questions, etc.)

Questions? See my blog post - http://dan.cx/blog/2011/06/twitter-autoreply-bot-dbznappa

Modified 2013-06-13 - Twitter API 1.0 discontinued, modified to use Twitter API 1.1

@naholyr
naholyr / update-sublime-text.sh
Created September 6, 2011 15:27
Install or update Sublime Text from web site
#!/bin/bash
# Requirements: sed, grep, curl, pkill
# User configuration
LOCAL_INSTALL="/usr/lib/sublime-text-2" # Must be user-writable
REPO="dev" # "dev" for dev releases, or "2" for beta releases
TARGET_BUILD="Linux 32 bit" # can be one of "Windows", "Windows 64 bit", "OS X", "Linux 32 bit", "Linux 64 bit"
# Check if sublime text is running
@hendrasan
hendrasan / gist:2412987
Created April 18, 2012 11:26
Direction aware Hover effect
(function(b,c){b.HoverDir=function(d,e){this.$el=b(e);this._init(d)};b.HoverDir.defaults={hoverDelay:0,reverse:false};b.HoverDir.prototype={_init:function(d){this.options=b.extend(true,{},b.HoverDir.defaults,d);this._loadEvents()},_loadEvents:function(){var d=this;this.$el.on("mouseenter.hoverdir, mouseleave.hoverdir",function(i){var g=b(this),h=i.type,e=g.find("div"),j=d._getDir(g,{x:i.pageX,y:i.pageY}),f=d._getClasses(j);e.removeClass();if(h==="mouseenter"){e.hide().addClass(f.from);clearTimeout(d.tmhover);d.tmhover=setTimeout(function(){e.show(0,function(){b(this).addClass("da-animate").addClass(f.to)})},d.options.hoverDelay)}else{e.addClass("da-animate");clearTimeout(d.tmhover);e.addClass(f.from)}})},_getDir:function(f,j){var e=f.width(),g=f.height(),d=(j.x-f.offset().left-(e/2))*(e>g?(g/e):1),k=(j.y-f.offset().top-(g/2))*(g>e?(e/g):1),i=Math.round((((Math.atan2(k,d)*(180/Math.PI))+180)/90)+3)%4;return i},_getClasses:function(e){var f,d;switch(e){case 0:(!this.options.reverse)?f="da-slideFromTop":f="da-sl
@5eleven
5eleven / Main.Sublime-menu file
Created July 4, 2012 09:07
Sublime Text 2 Layout: Grid: 6
// "Cols" and "Rows" specify the coordinates in x and y.
// Cells create cells by indexing the rows and cols array in the order [startx, starty, endx, endy].
// Edit your Main.Sublime-menu file
// Mac: /Users/yourMacName/Library/Application Support/Sublime Text 2/Packages/Default
// PC: C:\Users\yourPCName\AppData\Roaming\Sublime Text 2\Packages\Default
// Example Below:
{
"caption": "Grid: 6",
"command": "set_layout",
@MoOx
MoOx / less2stylus.js
Created August 27, 2012 17:37 — forked from lancejpollard/less2stylus.coffee
Convert LESS to Stylus
// Usage : less2stylusDir('../src/css/');
var fs = require('fs');
// this less 2 stylus conversion script make a stylus easy to read syntax
// - let the braces
// - replace the @ for var as $
// - let semicolons
function less2stylus(less)
@philipsharp
philipsharp / My\Views\Plates.php
Last active December 28, 2015 16:29
See: https://github.com/philipsharp/slim-view-plates for an installable package. Custom Slim Framework (http://www.slimframework.com/) view for Plates template system (http://platesphp.com/). License: MIT
<?php
namespace My\Views;
class Plates extends \Slim\View
{
/**
* @var \League\Plates\Engine
*/
protected $_engineInstance;
@dergachev
dergachev / ubuntu-eol.md
Last active July 16, 2024 20:12
What to do when your ubuntu distro is End-of-Life

Let's say you're using Ubuntu 13.04 (Raring Ringtail, released in April 2013) and it just went End-of-Life on you, because it's supported for only 6 months, and the deprecated packages are taken down after 12 months.

You'll probably figure this out the hard way. When you run sudo apt-get update, it will eventually report these errors:

Ign http://archive.ubuntu.com raring-updates/universe Sources/DiffIndex
Err http://security.ubuntu.com raring-security/main Sources
  404  Not Found [IP: 91.189.91.15 80]
Err http://security.ubuntu.com raring-security/universe Sources
  404  Not Found [IP: 91.189.91.15 80]
@rosskevin
rosskevin / Rakefile
Last active October 28, 2015 10:41
Rakefile - less to sass a.k.a. less2sass or less2scss
# less to scss based on http://stackoverflow.com/a/19167099/2363935
namespace :convert do
task :less_to_scss do
source_glob = "assets/less/*.less"
dest_dir = "converted"
rm_r dest_dir rescue nil
mkdir_p(dest_dir)
@imba3r
imba3r / twitcher.py
Created October 18, 2014 11:20
Dmenu for twitch.tv (for use with livestreamer)
#!/usr/bin/env python
#-------------------------------------------------
# file: twitcher.py
# author: Florian Ehmke
# description: dmenu for twitch streams
#-------------------------------------------------
import argparse
import requests
from subprocess import Popen, PIPE, STDOUT