Skip to content

Instantly share code, notes, and snippets.

View ptz0n's full-sized avatar

Erik Eng ptz0n

View GitHub Profile
@ptz0n
ptz0n / hawttrends.sh
Last active August 29, 2015 14:00
Hot Google Searches Searches in Sweden
curl http://hawttrends.appspot.com/api/terms/ | jq '.["42"]'
@ptz0n
ptz0n / cfg
Created October 29, 2014 12:47
CS:GO
// Rates
rate "128000"
cl_cmdrate "128"
cl_updaterate "128"
cl_interp "0.0"
cl_interp_ratio "1"
cl_lagcompensation "1"
// Mouse
sensitivity "2"
@ptz0n
ptz0n / example.php
Created March 18, 2011 08:42
Tågtider API - Example Request
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<h1>Tågtider API - Exempel</h1>
<pre><?php
// Setup
$url = 'http://api.tagtider.net/v1/stations.json';
$key = 'tagtider';
$secret = 'codemocracy';
@ptz0n
ptz0n / timetable.db.php
Created July 21, 2011 14:25
Magic call method for setting and removing object references with Redis
/**
* Basic call method for setting and removing object properties
*
* @param String $method
* @param Array $args
*
* @return Mixed
*
* @access public
*/
@ptz0n
ptz0n / gist:1361995
Created November 13, 2011 11:17
YN string to dates
/**
* YN string to dates
*
* @param string $from
* @param string $to
* @param string $yn
*
* @return array $dates
*/
function ynToDates($from, $to, $yn)
@ptz0n
ptz0n / gist:1362197
Created November 13, 2011 15:06
Seconds since midnight to date
<?php
/**
* Seconds since midnight to date
*
* @param string $date
* @param int $seconds
*
* @return string
*/
@ptz0n
ptz0n / gist:1560274
Created January 4, 2012 14:30
Convert geographical coordinates with Triona
<?php
/**
* Convert coordinates with projection
*
* @param string $easting X coordinate
* @param string $northing Y coordinate
* @param string $projection
*
* @return array
@ptz0n
ptz0n / _respond.scss
Created July 22, 2012 10:11
Sass respond to mixin
@mixin respond-to($media) {
@if $media == landscape {
@media screen and (min-width: 321px) { @content; }
}
@else if $media == tablet {
@media only screen and (min-width: 768px) { @content; }
}
@else if $media == desktop {
@media only screen and (min-width: 992px) { @content; }
}
@ptz0n
ptz0n / widget.js
Created July 25, 2012 06:20
Tågtider JavaScript Widget
// See http://alexmarandon.com/articles/web_widget_jquery/
(function() {
// Localize jQuery variable
var jQuery;
var remoteJquery = 'http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js';
var localJquery = 'static/js/jquery-1.6.4.min.js';
/**
@ptz0n
ptz0n / gist:3298107
Created August 8, 2012 20:05
Pingdom last down check
<?php
$apiKey = 'foo123bar';
$username = 'you@domain.com';
$password = 'yourpassword';
$check = 123;
// Init cURL
$curl = curl_init();
// Set target URL
curl_setopt($curl, CURLOPT_URL, 'https://api.pingdom.com/api/2.0/checks/'.$check);