Skip to content

Instantly share code, notes, and snippets.

@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 -->
 

Rails naming conventions

General Ruby conventions

Class names are CamelCase.

Methods and variables are snake_case.

Methods with a ? suffix will return a boolean.

Failed building wheel for PyYAML
Running setup.py clean for PyYAML
Running setup.py bdist_wheel for SQLAlchemy: started
Running setup.py bdist_wheel for SQLAlchemy: finished with status 'done'
Stored in directory: /root/.cache/pip/wheels/89/38/e1/e121d77c19eeeee42baabc2e623f08285267daedbf2fea9dd7
Running setup.py bdist_wheel for SQLAlchemy-Utils: started
Running setup.py bdist_wheel for SQLAlchemy-Utils: finished with status 'done'
Stored in directory: /root/.cache/pip/wheels/eb/2b/fa/a7b34d1ebfc759948b471948616b8bb159d62ea0447cc2933c
Running setup.py bdist_wheel for wrapt: started
Running setup.py bdist_wheel for wrapt: finished with status 'done'
@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)
@kharysharpe
kharysharpe / android-emulator-homebrew.sh
Created March 30, 2018 22:13
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 / JSON API Response.md
Last active May 19, 2017 14:31
JSON API Response

Schema:


{
	success: true|false
	container: {}|[],
	meta: {
		page: [int],
		perPage: [int],
<?php
// Source: http://www.web-max.ca/PHP/email_1.php
$username = '';
$password = '';
$server = 'pop3.example.com'
$port = 110;
$cmd = array();
$cmd[] = "USER $username\r\n";
@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 / 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 / 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: