Skip to content

Instantly share code, notes, and snippets.

View benbyford's full-sized avatar
💭
looking for AI and ethics work

ben byford benbyford

💭
looking for AI and ethics work
View GitHub Profile
@cferdinandi
cferdinandi / README.md
Created October 15, 2020 15:45
A vanilla JS fork of Lettering.js
@kennygoff
kennygoff / pair-programming-bunny.js
Last active May 3, 2018 22:46
Bunny with sign ascii art meme with "this is your spot" for sharing code tasks with developers
//
// | ̄ ̄ ̄ ̄ ̄ ̄|
// | this is |
// | your |
// | spot |
// |__________|
// (\__/) ||
// (•ㅅ•) ||
// / づ
//
using UnityEngine;
using System.Collections;
public static class Vibration
{
#if UNITY_ANDROID && !UNITY_EDITOR
public static AndroidJavaClass unityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
public static AndroidJavaObject currentActivity = unityPlayer.GetStatic<AndroidJavaObject>("currentActivity");
public static AndroidJavaObject vibrator = currentActivity.Call<AndroidJavaObject>("getSystemService", "vibrator");
public static AndroidJavaClass vibrationEffectClass = new AndroidJavaClass("android.os.VibrationEffect");
@willurd
willurd / web-servers.md
Last active April 18, 2024 14:15
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@benrolfe
benrolfe / itunes-byte-request.php
Last active July 10, 2018 21:40
iTunes have recently requested that podcast downloads accept "byte range requests". This PHP code below will set the correct headers and serve up the MP3 file. Set $file_path to the path of the MP3 file. See http://blog.unit6websites.com/post/48778214025/byte-range-requests
<?php
$fp = @fopen( $file_path, 'rb' );
$size = filesize( $file_path );
$length = $size;
$start = 0;
$end = $size - 1;
header( "Accept-Ranges: 0-$length" );
@somatonic
somatonic / upload_images_to_page_form.php
Created November 26, 2012 22:08
Upload Images to new created Page Form Example
<?php
// front-end form example with multiple images upload
// add new page created on the fly and adding images
$message = '';
if($input->post->submit){
// tmp upload folder for additional security
@somatonic
somatonic / form-example.php
Last active September 14, 2021 01:46
PW simple form via API
<?php
$out = '';
// create a new form field (also field wrapper)
$form = $modules->get("InputfieldForm");
$form->action = "./";
$form->method = "post";
$form->attr("id+name",'subscribe-form');
@karlhorky
karlhorky / grayscale-disable.css
Created August 26, 2012 12:17
Cross-Browser CSS Grayscale
img.grayscale.disabled {
filter: url("data:image/svg+xml;utf8,&lt;svg xmlns=\'http://www.w3.org/2000/svg\'&gt;&lt;filter id=\'grayscale\'&gt;&lt;feColorMatrix type=\'matrix\' values=\'1 0 0 0 0, 0 1 0 0 0, 0 0 1 0 0, 0 0 0 1 0\'/&gt;&lt;/filter&gt;&lt;/svg&gt;#grayscale");
-webkit-filter: grayscale(0%);
}
@gre
gre / easing.js
Last active April 16, 2024 19:53
Simple Easing Functions in Javascript - see https://github.com/gre/bezier-easing
/*
* This work is free. You can redistribute it and/or modify it under the
* terms of the Do What The Fuck You Want To Public License, Version 2,
* as published by Sam Hocevar. See the COPYING file for more details.
*/
/*
* Easing Functions - inspired from http://gizma.com/easing/
* only considering the t value for the range [0, 1] => [0, 1]
*/
EasingFunctions = {
@jakebellacera
jakebellacera / ICS.php
Last active March 11, 2024 05:12
A convenient script to generate iCalendar (.ics) files on the fly in PHP.
<?php
/**
* This is free and unencumbered software released into the public domain.
*
* Anyone is free to copy, modify, publish, use, compile, sell, or
* distribute this software, either in source code form or as a compiled
* binary, for any purpose, commercial or non-commercial, and by any
* means.
*