Skip to content

Instantly share code, notes, and snippets.

@nrdobie
nrdobie / drag-circle.coffee
Created September 4, 2012 19:43
Drag-n-Drop CSS3 Circle
jQuery ->
$('#drag-circle .play-area .draggable').draggable
containment: "parent"
$('#drag-circle .play-area .droppable').droppable
hoverClass: "drag-over"
drop: (event, ui)->
$(@).addClass "dropped"
$(ui.draggable[0])
activate: () ->
$(@).removeClass "dropped"
@nrdobie
nrdobie / block-shadow-mixer.css
Created September 5, 2012 19:50
Makes a block shadow CSS3 effect.
/* line 5, projects/block-shadow-mixer.css.sass */
#block-shadow-mixer .play-area h1, #block-shadow-mixer .play-area h2, #block-shadow-mixer .play-area h3 {
font-family: "ff-cocon-web-pro";
margin-bottom: 20px; }
/* line 9, projects/block-shadow-mixer.css.sass */
#block-shadow-mixer .play-area h1 em, #block-shadow-mixer .play-area h2 em, #block-shadow-mixer .play-area h3 em {
font-family: "bistro-script-web"; }
/* line 11, projects/block-shadow-mixer.css.sass */
#block-shadow-mixer .play-area h1 {
color: #ff1d23;
@nrdobie
nrdobie / Social Header
Created February 9, 2013 04:48
A CodePen by Nicholas Dobie. Social Network Profile Header - This is a social network profile header that was done entirely in CSS and HTML.
<h1>GitSocial <small>A social network for programmers.</small></h1>
<header>
<figure class="profile-banner">
<img src="https://s3.amazonaws.com/doubleslash-codepen/mnpls.jpg" alt="Profile banner" />
</figure>
<figure class="profile-picture"
style="background-image: url('https://s3.amazonaws.com/doubleslash-codepen/me-and-arron.jpg')">
</figure>
<div class="profile-stats">
<ul>
@nrdobie
nrdobie / install-rubymine.sh
Last active February 12, 2018 12:26
Install RubyMine on Fedora. Run file as `root`. When RubyMine asks you to install you can just ignore it.
#!/bin/sh
SHORTCUT="[Desktop Entry]
Name=RubyMine 6.3
Comment=Edit text files
Exec=/usr/local/ruby-mine/bin/rubymine.sh
Icon=/usr/local/ruby-mine/bin/RMlogo.svg
Terminal=false
Type=Application
Encoding=UTF-8
Categories=Utility;TextEditor;Ruby;Development;"
#!/bin/sh
SHORTCUT="[Desktop Entry]
Name=Sublime Text 2
Comment=Edit text files
Exec=/usr/local/sublime-text-2/sublime_text
Icon=/usr/local/sublime-text-2/Icon/128x128/sublime_text.png
Terminal=false
Type=Application
Encoding=UTF-8
Categories=Utility;TextEditor;"
@nrdobie
nrdobie / install-sublime-text-3.sh
Created October 28, 2013 22:12
Installs Sublime Text 3 on Linux. Make sure to mark as executable.
#!/bin/sh
SHORTCUT="[Desktop Entry]
Version=1.0
Type=Application
Name=Sublime Text 3
GenericName=Text Editor
Comment=Sophisticated text editor for code, markup and prose
Exec=/usr/local/sublime-text-3/sublime_text %F
Terminal=false
MimeType=text/plain;
@nrdobie
nrdobie / max7219_max7221.ino
Last active July 1, 2023 20:29
Basic code for using Maxim MAX7219/MAX7221 with Arduino.
/*
Basic code for using Maxim MAX7219/MAX7221 with Arduino.
Wire the Arduino and the MAX7219/MAX7221 together as follows:
| Arduino | MAX7219/MAX7221 |
| --------- | --------------- |
| MOSI (11) | DIN (1) |
| SCK (13) | CLK (13) |
| I/O (7)* | LOAD/CS (12) |
#include <AccelStepper.h>
//AccelStepper stepper
#define BUTTON_PIN 8
#define MOTOR_DIRECTION_PIN 2
#define MOTOR_STEPPER_PIN 3
#define MOTOR_ACCELERATION 80000
#define SENSOR_1 A0
#define SENSOR_2 A5
//set up the accelStepper intance
#include <SPI.h>
uint8_t animation [22] = {
0b01000000,
0b01100000,
0b01100001,
0b01100101,
0b01101101,
0b01111101,
0b01111101,
#include <SPI.h>
void setup() {
// We will need to control the Load/CS pin so
// make a pin an output, for this example I'll
// use pin 7.
pinMode(7, OUTPUT);
// The Maxim chip need the most siginifcant