Skip to content

Instantly share code, notes, and snippets.

View Jalle19's full-sized avatar

Sam Stenvall Jalle19

  • Nitor Creations Oy
  • Karis
View GitHub Profile
@Jalle19
Jalle19 / CListView_nojs.patch
Created August 15, 2012 13:56
CListView 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 @@
*/

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:

@Jalle19
Jalle19 / dyfi-update.service
Created August 26, 2018 19:10
dy.fi systemd unit
[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
@Jalle19
Jalle19 / bundle-size-checker.sh
Created September 5, 2018 11:13
Figure out which changes affected the bundle size the most
#!/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
@Jalle19
Jalle19 / createSelectionSetAppendingTransform.js
Created December 21, 2018 11:29
createSelectionSetAppendingTransform
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 / GraphQLService.php
Created May 15, 2019 12:48
Example of advanced graphql-php usage
<?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 / hath.service
Created July 11, 2019 11:46
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
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);
@Jalle19
Jalle19 / gist:60532513bbcec2fa630a9d8b576d91e3
Created December 18, 2021 15:27
stunnel systemd service
[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