Skip to content

Instantly share code, notes, and snippets.

View arbitrarily's full-sized avatar

Marko Bajlovic arbitrarily

View GitHub Profile
@garyharan
garyharan / _mixins.scss
Created May 5, 2011 15:46
Useful scss mixins (rounded corners, gradients, text-field, button)
@mixin box-shadow($top, $left, $blur, $color, $inset: false) {
@if $inset {
-webkit-box-shadow:inset $top $left $blur $color;
-moz-box-shadow:inset $top $left $blur $color;
box-shadow:inset $top $left $blur $color;
} @else {
-webkit-box-shadow: $top $left $blur $color;
-moz-box-shadow: $top $left $blur $color;
box-shadow: $top $left $blur $color;
}
@lucasfais
lucasfais / gist:1207002
Created September 9, 2011 18:46
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@ninnypants
ninnypants / remove-empty-p.php
Last active January 3, 2023 01:11
Remove empty p tags from WordPress posts
<?php
add_filter( 'the_content', 'remove_empty_p', 20, 1 );
function remove_empty_p( $content ){
// clean up p tags around block elements
$content = preg_replace( array(
'#<p>\s*<(div|aside|section|article|header|footer)#',
'#</(div|aside|section|article|header|footer)>\s*</p>#',
'#</(div|aside|section|article|header|footer)>\s*<br ?/?>#',
'#<(div|aside|section|article|header|footer)(.*?)>\s*</p>#',
'#<p>\s*</(div|aside|section|article|header|footer)#',
@dalethedeveloper
dalethedeveloper / gist:1846552
Created February 16, 2012 17:18
Techniques for Anti-Aliasing @font-face on Windows

#Techniques for Anti-Aliasing @font-face on Windows

It all started with an email from a client: Do these fonts look funky to you? The title is prickly.

The font in question was Port Lligat Sans from Google Web Fonts.

The "prickly" is aliasing caused by lack of hinting

@hanleybrand
hanleybrand / requests_image.py
Created December 6, 2012 03:56
Download images with Requests: HTTP for Humans
import requests
from io import open as iopen
from urlparse import urlsplit
def requests_image(file_url):
suffix_list = ['jpg', 'gif', 'png', 'tif', 'svg',]
file_name = urlsplit(file_url)[2].split('/')[-1]
file_suffix = file_name.split('.')[1]
i = requests.get(file_url)
if file_suffix in suffix_list and i.status_code == requests.codes.ok:
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active May 2, 2024 05:55
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@mikedewar
mikedewar / instapaper_xauth
Created February 17, 2013 01:44
This is an example script to get the list of articles on your instapaper account. You need to ask Instapaper for xauth access and you (or your user) need to be an instapaper subscriber ($3 a month) to be able to see the API.
from __future__ import unicode_literals
from urlparse import parse_qs
import requests
from requests_oauthlib import OAuth1
key = "key"
secret ="secret"
oauth = OAuth1(key, secret)
@willurd
willurd / web-servers.md
Last active May 6, 2024 13:43
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@don1138
don1138 / font-stacks.css
Last active April 25, 2024 15:41
CSS Modern Font Stacks
/* Modern Font Stacks */
/* System */
font-family: system, -apple-system, ".SFNSText-Regular", "San Francisco", "Roboto", "Segoe UI", "Helvetica Neue", "Lucida Grande", sans-serif;
/* System (Bootstrap 5.2.0) */
font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
/* Times New Roman-based serif */
font-family: Cambria, "Hoefler Text", Utopia, "Liberation Serif", "Nimbus Roman No9 L Regular", Times, "Times New Roman", serif;
@jbwyme
jbwyme / Mixpanel PHP API Example Index.php
Last active August 4, 2017 12:32
Mixpanel PHP API Usage
<?php
require_once("/path/to/vendor/mixpanel/mixpanel-php/lib/Mixpanel.php"); // import the Mixpanel class
// get the Mixpanel singelton (will be created if it doesn't exist)
$mp = Mixpanel::getInstance("MIXPANEL_PROJECT_TOKEN");
// this would likely come from a database or session variable
$user_id = 12345;