Skip to content

Instantly share code, notes, and snippets.

@loicknuchel
loicknuchel / angularPlugin.js
Created January 21, 2015 10:20
Angular MediaSrv : play audio with Cordova & Ionic apps
angular.module('my.cordova.plugins', ['ionic'])
// for media plugin : http://plugins.cordova.io/#/package/org.apache.cordova.media
.factory('MediaSrv', function($q, $ionicPlatform, $window){
var service = {
loadMedia: loadMedia,
getStatusMessage: getStatusMessage,
getErrorMessage: getErrorMessage
};
@juanbzpy
juanbzpy / social-options-wp.md
Last active October 15, 2017 15:04
How to add social icons using Option Tree and Font Awesome in WordPress

in header.php

<?php
  if ( function_exists( 'ot_get_option' ) ) {
    $social_media_channels = array(
      "Facebook" => "fa fa-facebook-square",
      "Twitter" => "fa fa-twitter-square",
      "Google+" => "fa fa-google-plus-square",
 "Linkedin" =&gt; "fa fa-linkedin-square",

Client:

var table_id = 1; // example, python will give this value

var socket = io('http://localhost:3000/table'+table_id');
socket.on('connect', function() {
	console.log('Connected');
	socket.emit('join', "table_"+table_id);
});
@saltun
saltun / gist:439794ab032b7a894d91
Created April 29, 2014 19:53
PHP TC Kimlik Numarası Doğrulama
<meta charset="utf-8">
<?php
function tcno_dogrula($bilgiler){
$gonder = '<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<TCKimlikNoDogrula xmlns="http://tckimlik.nvi.gov.tr/WS">
<TCKimlikNo>'.$bilgiler["tcno"].'</TCKimlikNo>
<Ad>'.$bilgiler["isim"].'</Ad>
@joshhartman
joshhartman / crypt.class.php
Last active November 25, 2022 10:10
Rijndael 256-bit Encryption (CBC) Class
<?php
class Crypt {
private $key;
function __construct($key){
$this->setKey($key);
}
@eddmann
eddmann / SecureSessionHandler.php
Created April 9, 2014 12:18
Secure session handler implementation.
<?php
class SecureSessionHandler extends SessionHandler {
protected $key, $name, $cookie;
public function __construct($key, $name = 'MY_SESSION', $cookie = [])
{
$this->key = $key;
$this->name = $name;
@emil2k
emil2k / Connectivity.java
Last active December 22, 2023 06:03
Android utility class for checking device's network connectivity and speed.
/*
* Copyright (c) 2017 Emil Davtyan
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
@Latz
Latz / disablexmlrpc
Created September 28, 2012 15:17
Sample plugin for diabling XMLRPC server for WordPress >= v3.5
<?php
/**
* Plugin Name: Disable XMLRPC
* Version: 0.1
* Plugin URI: http://wpengineer.com/?p=2484
* Description: Disable XMLRPC server for WP >= v3.5
* Author: Lutz Schröer
* Author URI: http://elektroelch.net/
*/
@jonmaim
jonmaim / zip.php
Last active January 22, 2024 00:19
PHP script to remotely create zip archives of your FTP
<?php
/*
*
* This script will backup your web site by remotely archiving all files on the root FTP directory.
* It will work even if your web server is memory limited buy splitting zips in several arhive files it they are too many files.
* All zip files will be stored in a directory called temporary which must be writable.
*
* How to use it:
* - Place the script at the root of your FTP.