Skip to content

Instantly share code, notes, and snippets.

View Ciantic's full-sized avatar

Jari Pennanen Ciantic

View GitHub Profile
@Ciantic
Ciantic / cloudflare-dyndns-a-aaaa-record-update.sh
Last active April 27, 2024 13:03
cloudflare dyndns script / update a A and AAAA record using bash script
#!/bin/bash
# Author: Jari Pennanen
# Url: https://gist.github.com/Ciantic/4e543f2d878a87a38c25032d5c727bf2
AUTH_EMAIL="john.doe@example.com" # Your Cloudflare email
AUTH_KEY="" # Get this from My profile -> API Keys -> View
DOMAIN="example.com" # main domain
SUBDOMAIN="home.example.com" # set A and AAAA-record of this subdomain
@Ciantic
Ciantic / wp_mail_disable.php
Last active March 4, 2020 08:59
Disable wp_mail, and save to file only
<?php
/**
* WP Mail for the development site, should not be used on production site
*
* Throw this in to your *wp_config.php*
*/
function wp_mail($to, $subject, $message, $headers = '', $attachments = array() ) {
$emails_dir = __DIR__ . "/.emails/";
if (!file_exists($emails_dir)) {
mkdir($emails_dir);
@Ciantic
Ciantic / keybase.md
Last active June 6, 2018 10:44
keybase.md

Keybase proof

I hereby claim:

  • I am ciantic on github.
  • I am ciantic (https://keybase.io/ciantic) on keybase.
  • I have a public key whose fingerprint is 2553 436D 15D9 818A 85F1 0B0D A684 B8D5 C267 FAF1

To claim this, I am signing this object:

@Ciantic
Ciantic / draft-js-retain-only-inline-styles.tsx
Last active May 31, 2018 11:28
Retain only specific inline styles
import {
CharacterMetadata,
ContentBlock,
ContentState,
Editor,
EditorState
} from "draft-js";
import * as Immutable from "immutable";
const blockRenderMap = Immutable.Map({
@Ciantic
Ciantic / AsyncRoute.tsx
Last active April 19, 2018 21:31
AsyncRoute tool
import * as React from "react";
import * as ReactDOM from "react-dom";
import { Route, Link } from "react-router-dom";
export const App = () => {
return (
<div>
<Link to="/">Roog</Link>
<br />
<Link to="/home">Home</Link>
@Ciantic
Ciantic / Indexer.php
Last active August 31, 2018 15:44
Fixing a PHP Language Server for my own taste
<?php
/**
* Will read and parse the passed source files in the project and add them to the appropiate indexes
*
* @return Promise <void>
*/
public function index(): Promise
{
return coroutine(function () {
@Ciantic
Ciantic / EnsureUser.cs
Created March 20, 2018 21:58
Temp store for this thingie
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
public class EnsureUser : Attribute, IActionFilter
{
private readonly string authName;
public EnsureUser(string authName)
{
this.authName = authName;
}
@Ciantic
Ciantic / keymap.c
Created September 18, 2017 16:54 — forked from DanielGGordon/keymap.c
my current keymap for my ergodox, using QMK
#include QMK_KEYBOARD_H
#include "debug.h"
#include "action_layer.h"
#include "version.h"
#include "keymap_german.h"
#include "keymap_nordic.h"
#include QMK_KEYBOARD_H
#include "debug.h"
#include "action_layer.h"
#include "version.h"
#include "keymap_german.h"
#include "keymap_nordic.h"
@Ciantic
Ciantic / testkeymap.c
Created July 14, 2017 20:01
Test keymap
#include "ergodox.h"
#include "debug.h"
#include "action_layer.h"
#include "version.h"
#define BASE 0 // default layer
#define SYMB 1 // symbols
#define MDIA 2 // media keys
enum custom_keycodes {