Skip to content

Instantly share code, notes, and snippets.

View tpiekarski's full-sized avatar
⌨️

Thomas Piekarski tpiekarski

⌨️
View GitHub Profile
@pascalduez
pascalduez / demo.module
Created December 24, 2011 15:02
Drupal 7 — Basic Ajax form submit (Ajax framework)
<?php
/**
* @file
* Demo module, Basic Ajax form submit (Ajax framework).
*/
/**
* Implements hook_menu().
*/
@SchumacherFM
SchumacherFM / realurl_conf.php
Created July 24, 2012 19:28
Multidomain with RealURL #TYPO3
<?php
/*
assuming the following folder structure:
typo3conf/
|
L ext/
L domainconfig/
|
L domain-global.inc.php
L domain-de.inc.php
@becw
becw / example.install.php
Last active March 26, 2019 06:53
Enable/revert a feature in a Drupal update hook #drupal7
/**
* EXAMPLE FEATURE UPDATE
* Enable and revert the my_new_feature_name feature.
*/
function example_update_7001() {
// An array of new or changed features; the array keys are feature names,
// values are an array of exportable types as seen in a feature's .info file:
// features[field][] = node-page-body
$features = array(
'my_new_feature_name' => array('field', 'variable'),
@lucadegasperi
lucadegasperi / ProjectController.php
Created April 19, 2014 08:51
Controller Cleanup + Interface
<?php
class ProjectController extends BaseController implements ProjectCreatorDelegate
{
public function store()
{
$creator = new ProjectCreator($this);
return $creator->create(Input::all());
}
@ipedrazas
ipedrazas / gist:6d6c31144636d586dcc3
Last active July 10, 2023 16:24
Nginx ssl config

The process starts by creating the CSR and the private key:

openssl req -nodes -newkey rsa:2048 -nodes -keyout dotmarks.net.key -out dotmarks.net.csr -subj "/C=GB/ST=London/L=London/O=dotmarks/OU=IT/CN=dotmarks.net"

Generates

  • dotmarks.net.key
  • dotmarks.net.csr
@coryhouse
coryhouse / package.json
Last active April 26, 2024 13:01
Example of calling one script from another
{
"name": "npm-scripts-example",
"version": "1.0.0",
"description": "npm scripts example",
"scripts": {
"clean": "rimraf ./dist && mkdir dist",
"prebuild": "npm run clean",
"build": "cross-env NODE_ENV=production webpack"
}
}
@jiahao
jiahao / nrules.svg
Last active May 17, 2022 08:30
What do .gitignore files tell us about the inherent complexity of programming languages? This gist can be run on data from GitHub's own collection of gitignore templates, whose repository is at https://github.com/github/gitignore, and counts how many rules are present in the template for each programming language.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tpiekarski
tpiekarski / tobii-stream-sdk.pri
Created August 25, 2018 07:44
Integration of Tobii Stream SDK into Qt Build Process
# Integration of Tobii Stream SDK into Qt Build Process
#
# Reference:
# http://doc.qt.io/qt-5/qmake-variable-reference.html#includepath
# http://doc.qt.io/qt-5/qmake-variable-reference.html#libs
# http://doc.qt.io/qt-5/qmake-test-function-reference.html#equals-variablename-value
# http://doc.qt.io/qt-5/qmake-language.html#replacing-values
#
# Environment Variable containing the path to Tobii Stream SDK
@tpiekarski
tpiekarski / express-exit-route.js
Created June 19, 2019 16:57
A HTTP-Route for exiting Node.js Server Process with Express
const express = require('express');
const app = express();
const port = 3000;
app.get('/exit', (req, res) => {
res.sendStatus(200);
res.on('finish', () => {
// Exiting process when the finish event was emited and the response was at least passed successfully to the operating system
// (for details see: https://nodejs.org/api/http.html#http_event_finish). Without that the HTTP status code 200 won't make it.
console.log(`Sent a 200, stoping to list for connections on ${port} and exiting process.`);