Skip to content

Instantly share code, notes, and snippets.

@notserk
notserk / dcgg-fightcade.ps1
Last active May 18, 2022 20:40
Fightcade Setup Script
# Set-ExecutionPolicy -ExecutionPolicy AllSigned -Scope CurrentUser
# Source file location
$source = 'https://www.fightcade.com/download/windows'
# Destination to save the file
$destination = $HOME +'\Documents\fightcade.exe'
#Download the file
$ProgressPreference = 'SilentlyContinue'
Invoke-WebRequest -Uri $source -OutFile $destination
$ cd ~
$ sudo curl -sS https://getcomposer.org/installer | sudo php
$ sudo mv composer.phar /usr/local/bin/composer
$ sudo ln -s /usr/local/bin/composer /usr/bin/composer
then you can run
$ sudo composer install
@notserk
notserk / embed-drupal-block.tpl.php
Created May 11, 2016 14:48
Embed Drupal Blocks in Template Files
<?php
$block = module_invoke('block', 'block_view', '1');
print render($block['content']);
?>
@notserk
notserk / cache-table.sql
Last active May 11, 2016 14:50
Create Cache Table for Drupal 7.
CREATE TABLE `cache_path` (
`cid` varchar(255) NOT NULL DEFAULT '' COMMENT 'Primary Key: Unique cache ID.',
`data` longblob COMMENT 'A collection of data to cache.',
`expire` int(11) NOT NULL DEFAULT '0' COMMENT 'A Unix timestamp indicating when the cache entry should expire, or 0 for never.',
`created` int(11) NOT NULL DEFAULT '0' COMMENT 'A Unix timestamp indicating when the cache entry was created.',
`serialized` smallint(6) NOT NULL DEFAULT '0' COMMENT 'A flag to indicate whether content is serialized (1) or not (0).',
PRIMARY KEY (`cid`),
KEY `expire` (`expire`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Generic cache table for caching things not separated out...'
FROM debian:jessie
MAINTAINER Wouter Admiraal <wad@wadmiraal.net>
ENV DEBIAN_FRONTEND noninteractive
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
# Install packages.
RUN apt-get update
RUN apt-get install -y \
vim \
git \
<!DOCTYPE HTML>
<html lang="en" ng-app="myApp">
<head>
<meta charset="utf-8">
<title>Dynamic Pagination w/ Filtering</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="Kim Maida">
<!-- JS Libraries -->
// Long Polling (Recommened Technique - Creates An Open Connection To Server ∴ Fast)
(function poll(){
$.ajax({ url: "server", success: function(data){
//Update your dashboard gauge
salesGauge.setValue(data.value);
}, dataType: "json", complete: poll, timeout: 30000 });
})();