Skip to content

Instantly share code, notes, and snippets.

View patrioticcow's full-sized avatar
🎯
Focusing

Cristi C patrioticcow

🎯
Focusing
View GitHub Profile
@patrioticcow
patrioticcow / video.js
Created December 28, 2018 18:26
youtube
<template>
<section>
<div class="control section">
<div class="tags has-addons">
<span class="tag is-info is-large">Videos</span>
<span class="tag is-light is-large">for {{ vehicleName }}</span>
</div>
</div>
<div id="videoPlayerPlaceholder">
@patrioticcow
patrioticcow / wp_malware_removal.php
Last active December 24, 2016 06:30
WordPress Malware Removal
<?php
/**
* place between single quotes the
* path to your base public dir, or "html" dir or wherever you host your files
* nginx example: '/usr/share/<server_name>/html'
*/
$base = '';
function listFolderFiles($dir){
$ffs = scandir($dir);
@patrioticcow
patrioticcow / designer.html
Last active August 29, 2015 14:14
designer
<link rel="import" href="../topeka-elements/theme.html">
<link rel="import" href="../topeka-elements/topeka-resources.html">
<link rel="import" href="../topeka-elements/topeka-app.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
@color: #000;
.box{
background-color: @color;
}
@patrioticcow
patrioticcow / Observer Pattern
Created December 11, 2013 01:03
Observer Pattern
interface Observer {
function notify($obj);
}
class ExchangeRate {
static private $instance = NULL;
private $observers = array();
private $exchange_rate;
private function ExchangeRate() {
@patrioticcow
patrioticcow / Factory Pattern
Created December 11, 2013 01:02
Factory Pattern
abstract class User {
function __construct($name)
{
$this->name = $name;
}
function getName()
{
return $this->name;
}
// Permission methods
@patrioticcow
patrioticcow / Singleton Pattern
Created December 11, 2013 01:02
Singleton Pattern
class Logger {
static function getInstance()
{
if (self::$instance == NULL) {
self::$instance = new Logger();
}
return self::$instance;
}
private function __construct()
{
@patrioticcow
patrioticcow / Strategy Pattern
Created December 11, 2013 00:54
Strategy Pattern
abstract class FileNamingStrategy {
abstract function createLinkName($filename);
}
class ZipFileNamingStrategy extends FileNamingStrategy {
function createLinkName($filename)
{
return "http://downloads.foo.bar/$filename.zip";
}
}