Skip to content

Instantly share code, notes, and snippets.

@350d
350d / config.json
Last active Oct 10, 2020 — forked from johannrichard/homebridge
Full install + Systemd Service for Homebridge
View config.json
{
"bridge": {
"name": "Homebridge",
"username": "{MAC}",
"port": 51826,
"pin": "{PIN}"
},
"description": "This is an example configuration file. You can use this as a template for creating your own configuration file containing devices you actually own.",
@350d
350d / phpinfo.css
Created Mar 22, 2014
Styles for phpinfo();
View phpinfo.css
html {
background: #fff;
margin:0;
padding:0;
}
body {
color: #233452;
height: 100%;
font-family: Verdana, Helvetica, sans-serif;
margin: 20px 0;
@350d
350d / cookie.js
Last active Feb 1, 2016
Simple library for Cookie manage
View cookie.js
View google_rss.js
function getRSS(url) {
$.getJSON('http://www.google.com/uds/Gfeeds',
{
context: 0,
num: 10,
hl: 'en',
output: 'json',
v: '1.0',
nocache: 0,
q: url
@350d
350d / functions.php
Created Oct 9, 2013
Disqus comment manager fix for Wordpress
View functions.php
function dsq_fix() {
echo '<style type="text/css">div.dsq-main {height:100%;min-height:100%;}</style>';
}
add_action('admin_head', 'dsq_fix');
@350d
350d / gaerror.js
Created Sep 20, 2013
Google Analytics Javascript errors tracking
View gaerror.js
$(window).error(function (error) {
if (error && error.originalEvent) {
error = error.originalEvent;
var message, url, line;
if (error && error.message) {
message = error.message;
url = getfilename(error.filename);
line = error.lineno;
} else {
message = "(message empty)";
@350d
350d / script.js
Created Mar 4, 2013
Photoshop Square Crop
View script.js
var savedRuler= app.preferences.rulerUnits;
app.preferences.rulerUnits = Units.PIXELS;
var w = app.activeDocument.width;
var h = app.activeDocument.height;
if(w>h) app.activeDocument.resizeCanvas (w, w, AnchorPosition.MIDDLECENTER);
if(w<h) app.activeDocument.resizeCanvas (h, h, AnchorPosition.MIDDLECENTER);
app.preferences.rulerUnits = savedRuler;
@350d
350d / Fullpage.html
Created Jun 19, 2012
A web page created at CodePen.io
View Fullpage.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Justified Menu / Block list &middot; CodePen</title>
<link rel="stylesheet" href="http://codepen.io/stylesheets/css/reset.css">
@350d
350d / 1_video.get
Created Nov 20, 2014
VK API / wall.get / video.get for 1 item / video.get for 2 item
View 1_video.get
print_r(json_decode(file_get_contents("https://api.vkontakte.ru/method/video.get?access_token=$token&owner_id=64842982&videos=64842982_170418653")));
stdClass Object
(
[response] => Array
(
[0] => 1
[1] => stdClass Object
(
[vid] => 170418653
@350d
350d / finctions.php
Created Oct 30, 2014
Wordpress: Youtube + Vimeo shortcodes for responsive layout
View finctions.php
function appthemes_add_quicktags() {
if (wp_script_is('quicktags')){
?>
<script type="text/javascript">
QTags.addButton( 'yt_embed', 'Youtube', '[youtube id="', '"]', 'y', 'Youtube Video', 1 );
QTags.addButton( 'vm_embed', 'Vimeo', '[vimeo id="', '"]', 'v', 'Vimeo Video', 2 );
</script>
<?php
}
}
You can’t perform that action at this time.