Skip to content

Instantly share code, notes, and snippets.

View tjoskar's full-sized avatar

Oskar Karlsson tjoskar

View GitHub Profile
@tjoskar
tjoskar / index.html
Last active October 1, 2015 15:28
HTML: Start
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="reset.css" />
<link rel="stylesheet" href="style.css" />
<title>Test</title>
</head>
<body>
@tjoskar
tjoskar / reset.css
Created March 11, 2012 13:03
CSS: Reset
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
@tjoskar
tjoskar / index.html
Created March 22, 2012 20:40
HTML5: Loading circle
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Demo</title>
<style type='text/css'>
@-webkit-keyframes rotate {
from {
-webkit-transform: rotate(0deg);
@tjoskar
tjoskar / tdtool.php
Created November 17, 2012 08:23
HA: TDTOOL php class
<?php
// Source: https://bitbucket.org/joelbitar/switchctrl/src/5854b847114e/webservice/tellstick.class.php
// This is the class that controls the communication with the tellstick
class Tellstick {
public $number_of_devices;
public $devices;
// Create object and get the current devices and their statuses
@tjoskar
tjoskar / month_array.php
Created November 25, 2012 09:56
Month array
array('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec')
@tjoskar
tjoskar / gist:5517266
Last active December 16, 2015 23:59
Commands
## Apache:
# enable site
sudo a2ensite
# disable site
sudo a2dissite
# enable an apache2 module
sudo a2enmod
@tjoskar
tjoskar / new_host.md
Last active December 17, 2015 23:29
Add a new virtual hosts for MAMP

How to add a new virtual hosts for MAMP


First, edit your hosts file.

$ sublime /etc/hosts

Add your new host, ie.

@tjoskar
tjoskar / enable_codecoverage.md
Created June 6, 2013 14:01
How enable xdebug and codecoverage for MAMP and phpunit

How enable xdebug and codecoverage for MAMP and phpunit


First, edit your php.init file

$ sublime /Applications/MAMP/bin/php/php5.x.xx/conf/php.ini

(You can find your php version by "php -v" and the path by "which php")

Basic MySQL Commands (that you should know)

Create a database.

$ mysqladmin -u[username] create [database name]

Alt.

$ CREATE DATABASE my_db;

Create a JS Object with Overwritable Settings

var Fancy = {
	settings: {
		something: 'one',
		somethingElse: 'two'
	},
	init: function(options){
 var s = $.extend({}, this.settings, options);