Skip to content

Instantly share code, notes, and snippets.

View jeremyphillips's full-sized avatar

Jeremy Phillips jeremyphillips

View GitHub Profile
@joepie91
joepie91 / vpn.md
Last active September 23, 2024 22:42
Don't use VPN services.

Don't use VPN services.

No, seriously, don't. You're probably reading this because you've asked what VPN service to use, and this is the answer.

Note: The content in this post does not apply to using VPN for their intended purpose; that is, as a virtual private (internal) network. It only applies to using it as a glorified proxy, which is what every third-party "VPN provider" does.

  • A Russian translation of this article can be found here, contributed by Timur Demin.
  • A Turkish translation can be found here, contributed by agyild.
  • There's also this article about VPN services, which is honestly better written (and has more cat pictures!) than my article.
@ry8806
ry8806 / jplayer-directive.js
Last active May 20, 2016 14:44
AngularJS and jPlayer directive
myApp.directive("jplayer", ['$window', 'PlayerService', function ($window, PlayerService) {
return {
restrict: "E",
// Have our own scope - we only want to watch the service and not conflict with other scopes
scope: {},
// Serve up some html with our player
templateUrl: "/jplayer-template.html",
link: function (scope, element, attrs) {
// An element on the page to attach the jPlayer to. Could also use "element" from linkFN ^
var jPlayer = angular.element("#jquery_jplayer_1").jPlayer();
@yoren
yoren / extra.php
Last active August 3, 2016 19:35
Cookie Authentication In A AngularJS WordPress Theme
<?php
// The following function is from: https://github.com/WP-API/WP-API/blob/2.0-beta4/extras.php#L84-L136
/**
* Check for errors when using cookie-based authentication.
*
* WordPress' built-in cookie authentication is always active
* for logged in users. However, the API has to check nonces
* for each request to ensure users are not vulnerable to CSRF.
*
* @global mixed $wp_rest_auth_cookie
@oronbz
oronbz / soundPlayer AngularJS Service
Last active August 14, 2018 13:45
This is a soundPlayer for AngularJS using the soundManager2 API.
// download soundManager2 and refer it in your scripts http://www.schillmania.com/projects/soundmanager2/doc/download/#latest
// also add the swf directory to your project
// your module declaration
var app = angular.module('myApp', []);
// attach the soundManager global for AngularJS dependency injection
app.value('soundManager', soundManager);
// usage
@daltonrooney
daltonrooney / file-upload-handler.php
Created February 4, 2012 13:29
Multi-file WordPress uploads from the front-end
<?php /* This function attaches the image to the post in the database, add it to functions.php */
function insert_attachment($file_handler,$post_id,$setthumb='false') {
// check to make sure its a successful upload
if ($_FILES[$file_handler]['error'] !== UPLOAD_ERR_OK) __return_false();
require_once(ABSPATH . "wp-admin" . '/includes/image.php');
require_once(ABSPATH . "wp-admin" . '/includes/file.php');
require_once(ABSPATH . "wp-admin" . '/includes/media.php');