Skip to content

Instantly share code, notes, and snippets.

@artero
artero / launch_sublime_from_terminal.markdown
Last active September 12, 2024 02:13 — forked from olivierlacan/launch_sublime_from_terminal.markdown
Launch Sublime Text 2 from the Mac OS X Terminal

Launch Sublime Text 2 from the Mac OS X Terminal

Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.

open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl

You can find more (official) details about subl here: http://www.sublimetext.com/docs/2/osx_command_line.html

Installation

@alanhogan
alanhogan / compass-retina-sprites.scss
Created June 5, 2012 23:21 — forked from thulstrup/compass-retina-sprites.scss
Using Compass to generate normal and retina sprite maps
$sprites: sprite-map("sprites/*.png");
$sprites-retina: sprite-map("sprites-retina/*.png");
@mixin sprite-background($name) {
background-image: sprite-url($sprites);
background-position: sprite-position($sprites, $name);
background-repeat: no-repeat;
display: block;
height: image-height(sprite-file($sprites, $name));
width: image-width(sprite-file($sprites, $name));
@norcross
norcross / login-string-check.php
Created December 20, 2012 01:15
check login URL for specific query string
<?php
/*
* Check the URL of the WordPress login
* page for a specific query string
*
* assumes login string is
* http://mysite.com/wp-login.php?question=answer
*/
function rkv_login_stringcheck() {
@MikeRogers0
MikeRogers0 / twitter-proxy.php
Last active June 3, 2019 12:56
This is a neat little script you can use to quickly make OAuth requests to the twitter rest API v1.1.
<?php
/**
* Usage:
* Send the url you want to access url encoded in the url paramater, for example (This is with JS):
* /twitter-proxy.php?url='+encodeURIComponent('statuses/user_timeline.json?screen_name=MikeRogers0&count=2')
*/
// The tokens, keys and secrets from the app you created at https://dev.twitter.com/apps
$config = array(
@Two9A
Two9A / starfield.html
Created April 19, 2015 16:45
The simplest star field you'll ever find
<title>Starfield</title>
<script>
addEventListener('load', function() {
var stars = [];
var ctx = field.getContext('2d');
var gen = function(z) {
return {
x: 0 | (Math.random() * 800 - 400),
y: 0 | (Math.random() * 600 - 300),
z: z || (0 | Math.random() * 15)
@acepek
acepek / pico-8-color-names-table.txt
Last active August 27, 2023 23:53
Pico-8 Palette Color Names in a Table
colors =
{
["black"] = 0,
["dark_blue"] = 1,
["dark_purple"] = 2,
["dark_green"] = 3,
["brown"] = 4,
["dark_gray"] = 5,
["light_gray"] = 6,
["white"] = 7,