Skip to content

Instantly share code, notes, and snippets.

Avatar

Sam Stenvall Jalle19

  • Nitor Creations Oy
  • Helsinki
View GitHub Profile
View gist:60532513bbcec2fa630a9d8b576d91e3
[Unit]
Description=stunnel
After=network.target
Requires=network.target
[Service]
Type=simple
# NOTE: "foreground = yes" must be added to the configuration file
ExecStart=/usr/local/bin/stunnel /etc/stunnel/stunnel.conf
TimeoutStopSec=5
View null.php
function printUser(string $name, int $age): string {
// $name == null never happens
// $age == null never happens
return sprintf('%s is %d years old', $name, $age);
}
echo printUser('Sam', 30);
View hath.service
[Unit]
Description=Hentai at Home
After=network.target
[Service]
Type=simple
User=hath
Group=hath
WorkingDirectory=/home/hath
ExecStart=/usr/bin/java -jar HentaiAtHome.jar
@Jalle19
Jalle19 / GraphQLService.php
Created May 15, 2019
Example of advanced graphql-php usage
View GraphQLService.php
<?php
namespace Foo\Bar\GraphQL;
use Digia\GraphQL\Error\Handler\ErrorHandlerInterface;
use Digia\GraphQL\Error\InvariantException;
use Digia\GraphQL\Execution\ExecutionResult;
use Digia\GraphQL\Language\Node\DocumentNode;
use Digia\GraphQL\Language\ParserInterface;
use Digia\GraphQL\Language\Source;
@Jalle19
Jalle19 / createSelectionSetAppendingTransform.js
Created Dec 21, 2018
createSelectionSetAppendingTransform
View createSelectionSetAppendingTransform.js
import { WrapQuery } from 'graphql-tools'
import { SelectionSetNode, Kind } from 'graphql'
/**
* Creates a WrapQuery schema transform that appends the specified field to the selection set of the
* specified parent field name. This can be used to assure queries used by dataloader include the
* field used to align the results (usually some "id" field)
* @param parentFieldName
* @param appendedFieldName
*/
@Jalle19
Jalle19 / bundle-size-checker.sh
Created Sep 5, 2018
Figure out which changes affected the bundle size the most
View bundle-size-checker.sh
#!/bin/bash
git log --oneline --pretty=format:"%h" yarn.lock | head -n 30 > last30_yarn_lock_commits.txt
while read REVISION; do
git show --oneline --quiet $REVISION
{
git checkout -f $REVISION
rm -rf node_moduels/
yarn install --production
View dyfi-update.service
[Unit]
Description=dy.fi update daemon
After=network.target
[Service]
Type=simple
ExecStart=/usr/local/bin/dyfi-update.pl -f /usr/local/etc/dyfi-update.conf
[Install]
WantedBy=multi-user.target
View keybase.md

Keybase proof

I hereby claim:

  • I am Jalle19 on github.
  • I am jalle19 (https://keybase.io/jalle19) on keybase.
  • I have a public key whose fingerprint is 6F98 3459 3C27 57E0 A056 3FB2 3BDA 639B 71C9 CD3F

To claim this, I am signing this object:

View CListView_nojs.patch
# This patch file was generated by NetBeans IDE
# Following Index: paths are relative to: C:\wamp\www\nsm
# This patch can be applied using context Tools: Patch action on respective folder.
# It uses platform neutral UTF-8 encoding and \n newlines.
# Above lines and this line are ignored by the patching process.
Index: framework/zii/widgets/CListView.php
--- framework/zii/widgets/CListView.php Base (BASE)
+++ framework/zii/widgets/CListView.php Locally Modified (Based On LOCAL)
@@ -191,34 +191,33 @@
*/