Skip to content

Instantly share code, notes, and snippets.

View yratof's full-sized avatar
🍊
Eating an orange

Andrew yratof

🍊
Eating an orange
View GitHub Profile
@jimsynz
jimsynz / rgb_spectrum.c
Created January 5, 2011 20:59
Arduino sketch to cycle an RGB LED through the colour spectrum.
const int redPin = 11;
const int greenPin = 10;
const int bluePin = 9;
void setup() {
// Start off with the LED off.
setColourRgb(0,0,0);
}
void loop() {
@maxhawkins
maxhawkins / schotter.pde
Created January 11, 2011 03:30
Processing copy of Georg Nees's classic media art piece Schotter.
// Support Classes
class Vec3f {
float x, y, z;
Vec3f(float x, float y, float z) {
this.x = x;
this.y = y;
this.z = z;
}
void scale(float scale) {
this.x *= scale;
@bradvin
bradvin / get_current_post_type.php
Created March 5, 2012 18:48 — forked from mjangda/get_current_post_type.php
Get the current post_type context in the WordPress admin.
<?php
/**
* gets the current post type in the WordPress Admin
*/
function get_current_post_type() {
global $post, $typenow, $current_screen;
//we have a post so we can just get the post type from that
if ( $post && $post->post_type )
return $post->post_type;
@arosenhagen
arosenhagen / magento-code-snippets.md
Last active April 8, 2024 09:21
[magento] - code snippets

Magento Code Snippets

Download extension manually using mage

./mage config-set preferred_state stable
./mage clear-cache
./mage sync
./mage download community Module_Name
@gregrickaby
gregrickaby / remove-woocommerce-styles-scripts.php
Last active April 25, 2024 09:45
Remove WooCommerce styles and scripts.
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below into functions.php
/**
* Manage WooCommerce styles and scripts.
*/
function grd_woocommerce_script_cleaner() {
// Remove the generator tag
remove_action( 'wp_head', array( $GLOBALS['woocommerce'], 'generator' ) );
@isGabe
isGabe / wp_custom_title_placeholder_text.php
Last active February 25, 2019 21:28
WordPress: Custom placeholder text for custom post type title input box #snippet #WordPress
<?php
/*
replacing the default "Enter title here" placeholder text in the title input box
with something more descriptive can be helpful for custom post types
place this code in your theme's functions.php or relevant file
source: http://flashingcursor.com/wordpress/change-the-enter-title-here-text-in-wordpress-963
*/
@malarkey
malarkey / Contract Killer 3.md
Last active April 16, 2024 21:44
The latest version of my ‘killer contract’ for web designers and developers

When times get tough and people get nasty, you’ll need more than a killer smile. You’ll need a killer contract.

Used by 1000s of designers and developers Clarify what’s expected on both sides Helps build great relationships between you and your clients Plain and simple, no legal jargon Customisable to suit your business Used on countless web projects since 2008

…………………………

@jareware
jareware / SCSS.md
Last active April 23, 2024 22:13
Advanced SCSS, or, 16 cool things you may not have known your stylesheets could do

⇐ back to the gist-blog at jrw.fi

Advanced SCSS

Or, 16 cool things you may not have known your stylesheets could do. I'd rather have kept it to a nice round number like 10, but they just kept coming. Sorry.

I've been using SCSS/SASS for most of my styling work since 2009, and I'm a huge fan of Compass (by the great @chriseppstein). It really helped many of us through the darkest cross-browser crap. Even though browsers are increasingly playing nice with CSS, another problem has become very topical: managing the complexity in stylesheets as our in-browser apps get larger and larger. SCSS is an indispensable tool for dealing with this.

This isn't an introduction to the language by a long shot; many things probably won't make sense unless you have some SCSS under your belt already. That said, if you're not yet comfy with the basics, check out the aweso

@halfempty
halfempty / functions.php
Created June 18, 2013 19:10
Show and save data to WordPress user profiles
add_action( 'show_user_profile', 'my_show_extra_profile_fields' );
add_action( 'edit_user_profile', 'my_show_extra_profile_fields' );
function my_show_extra_profile_fields( $user ) { ?>
<h3>Extra profile information</h3>
<table class="form-table">
#Make a new branch:
gco -b new_branch
#do bunch of changes
ga -A
gc -m "Made a bunch of changes"
#checkout master
gco master
#get the latest updates to master
gl
#Go back to new_branch or whatever you called it