Skip to content

Instantly share code, notes, and snippets.

@350d
350d / keybase.md
Created April 18, 2022 19:39
keybase.md

Keybase proof

I hereby claim:

  • I am 350d on github.
  • I am 350d (https://keybase.io/350d) on keybase.
  • I have a public key ASCJMuqnbWO2puwD3jG1oIcUNq5Wov_3p2wY9gnY7GbEsAo

To claim this, I am signing this object:

@350d
350d / config.json
Last active October 10, 2020 14:05 — forked from johannrichard/homebridge
Full install + Systemd Service for Homebridge
{
"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 / google_rss.js
Created January 12, 2016 15:03
Google RSS
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 / 1_video.get
Created November 20, 2014 02:53
VK API / wall.get / video.get for 1 item / video.get for 2 item
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 October 30, 2014 16:40
Wordpress: Youtube + Vimeo shortcodes for responsive layout
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
}
}
@350d
350d / jquery.raf.js
Created October 29, 2014 13:16
jQuery RequestAnimationFrame Plugin
(function(jQuery){
'use strict';
if (!Date.now) Date.now = function() { return new Date().getTime(); };
var animating,
vendors = ['moz', 'webkit'],
W = window;
for (var i = 0; i < vendors.length && !W.requestAnimationFrame; ++i) {
var vp = vendors[i];
@350d
350d / 0.gif
Created September 26, 2014 03:27
Transparent .GIF 1x1 px Base64 encoded
data:image/gif;base64,R0lGODdhAQABAPAAAMPDwwAAACwAAAAAAQABAAACAkQBADs=
@350d
350d / isie.js
Created September 24, 2014 21:58
Internet Explorer Browser Detector ( method that does not depend on the navigator.userAgent )
function isIE() {
return typeof document.documentMode == "number" || eval("/*@cc_on!@*/!1");
}
property image_extension_list : {"tif", "tiff", "gif", "png", "pict", "pct", "jpg", "jpeg", "bmp"}
property video_extension_list : {"avi", "mov", "mpg", "mpeg", "wmv", "mp4", "m4a"}
property audio_extension_list : {"mp3", "wav", "aac"}
property archive_extension_list : {"zip", "sit", "tar", "tgz", "gz", "bzip2"}
property documents_extension_list : {"doc", "docx", "pdf", "txt", "xls", "xslx", "ppt"}
property diskAlignLeft : true
property otherAlignLeft : false
property margin : {50, 60, 0, 0} -- {left, top, right, bottom}
property xPadding : 50
property yPadding : 50
@350d
350d / debounce.js
Last active August 29, 2015 14:03
Javascript debounce
Function.prototype.debounce = function(delay) {
var timeout, callback = this;
return function() {
clearTimeout(timeout);
timeout = setTimeout(callback, delay);
}
}