Skip to content

Instantly share code, notes, and snippets.

View michaelx's full-sized avatar

Michael Xander michaelx

View GitHub Profile
@romac
romac / sc_sync.sh
Created March 7, 2011 10:36
Sync SoundCloud.app's playlists over Dropbox.
# Enable SoundCloud.app to sync its playlists over DropBox.
# You'll have to launch it on every computers you want to sync together.
# 1. Download the script.
# 2. Edit the SC_DROPBOX_PATH variable if your DropBox folder is not located inside your home folder.
# 3. Lauch Terminal.app.
# 4. Browse to the directory where the script is located: `cd /path/to/folder`
# 5. Make the script executable: `chmod +x sc_sync.sh`
# 6. Launch the script: `./sc_sync.sh`
@upvalue
upvalue / amazon.rb
Last active December 23, 2016 06:01
Amazon affiliate filters for jekyll.
# amazon.rb - amazon affiliate links for jekyll
# assumes that you have a configuration variable called 'amazon_associate_id' with your associate id
# usage: {{ asin | amazon_product_href }}
# returns url of a product
# usage: {{ asin | amazon_image_href: 'M' }}
# returns image of the product, size argument can be S, M, or L, default M
# usage: {{ asin | amazon_product: 'A Product' }}
@hemp
hemp / bitbucket-soft-wrap-diffs.md
Last active July 23, 2018 15:47
bitbucket soft-wrap diffs bookmarklet

BitBucket Soft-Wrap Diffs Bookmarklet

Soft-Wrap Diffs GIF on Imgur

Create a bookmark in Chrome or Firefox and copy/paste this code into the URL.

javascript:(function()%7Bvar%20a%3Ddocument.createElement('style')%2Cb%3Bdocument.head.appendChild(a)%3Bb%3Da.sheet%3Bb.insertRule('.udiff-line%20.source%20%7B%20height%3A%20initial%3B%20white-space%3A%20pre-wrap%3B%20word-wrap%3A%20normal%3B%20%7D'%2C0)%3B%7D)()

This bookmarklet adds the following user-style:

@hail2u
hail2u / twitter-bird.svg
Created June 6, 2012 20:39
SVG version of the new Twitter bird.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@vasilisvg
vasilisvg / more.md
Last active December 4, 2020 04:48
This is my backup script which syncs my server to my dropbox every day.

The script below is triggered every day from my Mac. I use Hazel to move the tar.gz to an external hard disk once it's finished. This happens every day without me noticing. You can exclude folders if you want to. You probably want to exclude giant cache folders.

You should have a similar script.

React Native Folder Structure

Motivations

  • Sharing what has worked for me in different React Native projects
  • Reusing screens in different parts of your app
  • Easy to work separately in a feature
  • Add an extra level (nested folder) only when necessary
  • Don't overuse index.js for everything
@matthewowen
matthewowen / raw_content.rb
Created November 6, 2012 15:39
access raw content in jekyll
module Jekyll
class RawContent < Generator
def generate(site)
site.posts.each do |post|
post.data['raw_content'] = post.content
end
end
@brettkelly
brettkelly / makeAmazonAffUrl.py
Created July 15, 2012 04:29
Python to rework Amazon URL to contain the user's affiliate code
#!/usr/bin/env python
# (c) 2012 Brett Kelly.
# Licensed under the MIT license
# http://www.opensource.org/licenses/mit-license.php
import re
import sys
from urlparse import urlparse
@jackiekazil
jackiekazil / rounding_decimals.md
Last active January 17, 2024 12:29
How do I round to 2 decimals in python?

How do I round to 2 decimals?

In python, you have floats and decimals that can be rounded. If you care about the accuracy of rounding, use decimal type. If you use floats, you will have issues with accuracy.

All the examples use demical types, except for the original value, which is automatically casted as a float.

To set the context of what we are working with, let's start with an original value.

Original Value

#!/usr/bin/env ruby
# merge_asana_into_omnifocus.rb
# Hilton Lipschitz
# http://www.hiltmon.com
# Use and modify freely, attribution appreciated
# Script to import Asana projects and their tasks into
# OmniFocus and keep them up to date from Asana.