Skip to content

Instantly share code, notes, and snippets.

@kharysharpe
kharysharpe / Resize.php
Last active August 29, 2015 13:59 — forked from RStankov/Resize.php
<?php
/*
Original version:
written by Jarrod Oberto
taken from http://net.tutsplus.com/tutorials/php/image-resizing-made-easy-with-php/
Modified From:
@kharysharpe
kharysharpe / GIF-Screencast-OSX.md
Created February 24, 2017 02:11 — forked from dergachev/GIF-Screencast-OSX.md
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:

@kharysharpe
kharysharpe / Digital Project - Development Contract - Agency (or Company) to Freelancer.md Example contract for use by Creative, Digital and Marketing Agencies (or any company for that matter) to use when contracting a Freelance Web Developer on digital projects.

I've shared this contact for use by Creative, Digital and Marketing Agencies (or any company for that matter) to use when contracting a Freelance Web Developer on digital projects. Feel free to fork, amend and use for your own projects however please be nice and credit where credit is due and take a note of the disclaimer on this document.

My aim is to create a realistic, agreeable contract with as little unreadable jargon as possible. Hopefully this example contract achieves that and is useful to you, feel free to comment so I can amend.

PS: feel free to remove this section (of course) when using in your final docs.


 

@kharysharpe
kharysharpe / readme.md
Created March 14, 2017 16:36 — forked from xeoncross/readme.md
140 byte PHP routing framework (well, it's just a function actually)

140 byte PHP routing system.

This is a very simply routing system that makes it easy to test requests to different paths. This is very limited so do not use for your applications - it's just for fun.

require('route.php');

// A user profile
route('/(\w+)/profile', function($path, $user)
{

print "Hello " . $user;

@kharysharpe
kharysharpe / android-emulator-homebrew.sh
Created March 30, 2018 22:13 — forked from spilth/android-emulator-homebrew.sh
Android Emulator with Homebrew
touch ~/.android/repositories.cfg
brew cask install caskroom/versions/java8
brew cask install android-sdk
brew cask install intel-haxm
brew install qt
export ANDROID_SDK_ROOT="/usr/local/share/android-sdk"
sdkmanager "platform-tools" "platforms;android-27" "extras;intel;Hardware_Accelerated_Execution_Manager" "build-tools;27.0.0" "system-images;android-27;google_apis;x86" "emulator"
avdmanager create avd -n test -k "system-images;android-27;google_apis;x86"
/usr/local/share/android-sdk/tools/emulator -avd test
@kharysharpe
kharysharpe / postgres-cheatsheet.md
Created April 15, 2018 18:32 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)

Rails naming conventions

General Ruby conventions

Class names are CamelCase.

Methods and variables are snake_case.

Methods with a ? suffix will return a boolean.

@kharysharpe
kharysharpe / v-cloak.md
Created January 2, 2019 00:43 — forked from adamwathan/v-cloak.md
Useful CSS utilities for Vue.js cloaking

Handy helpers for controlling visibility of elements until Vue has compiled.

Use like:

<div v-cloak>
  <h1>
    <span class="v-cloak--inline">Loading...</span> <!-- Only displayed before compiling -->
    <span class="v-cloak--hidden">{{ post.title }}</span> <!-- Hidden until compiling is finished -->
 
@kharysharpe
kharysharpe / GetCardSwipe.js
Created August 12, 2019 12:55 — forked from marothstein/GetCardSwipe.js
Basic implementation of methods needed to receive swiped credit card data with javascript.
/*
* Basic implementation of methods needed to receive swiped credit card data with javascript.
*
* NOTE: PCI compliance specifies that card data must never be stored in an unencrypted manner, and
* only certain pieces of card data can be stored persistently. Ensure that output logging is NOT
* stored persistently when using this file, as it contains console.log messages that are intended
* to educate the user, and these messages contain data that may compromise your PCI compliance posture.
*
* If you choose to use any of this code with real credit card data, it is your responsibility
* to remove all log statements, output, or other code that may serve to persist offending information.
# This is a sample build configuration for PHP.
# Check our guides at https://confluence.atlassian.com/x/e8YWN for more examples.
# Only use spaces to indent your .yml configuration.
# You can specify a custom docker image from Docker Hub as your build environment.
# run composer check-platform-reqs for a list of required extensions.
image: php:7.2-fpm
pipelines:
default:
# Not needed unless you're doing feature tests.
# - step: