Skip to content

Instantly share code, notes, and snippets.

@HugsLibRecordKeeper
HugsLibRecordKeeper / gist:ef94b005b2eddb2477bbed6f2fe1db55
Created Sep 23, 2021
Rimworld output log published using HugsLib
We couldn’t find that file to show.
View Potential Maintainers
Maintainers:
obsidian-systems-maintenance: haskell.compiler.ghcjs810, haskell.compiler.ghcjs810, haskell.compiler.ghcjs810
View Changed Paths
i686-linux haskell.compiler.ghcjs810
aarch64-linux haskell.compiler.ghcjs810
x86_64-linux haskell.compiler.ghcjs810
View fugitivevim.md

Basic commands

:Git [args]              # does what you'd expect

all of your ~/.gitconfig aliases are available.

:Git! [args]             # same as before, dumping output to a tmp file

Moving inside a repo.

@famzil
famzil / index.js
Created Sep 23, 2021
Execution time of multiple observers on one observable
View index.js
// Execution time with multiple observers on the same observable
const currentTime$ = new Observable((subscriber) => {
const currentTime = new Date().toLocaleTimeString();
subscriber.next(currentTime);
subscriber.complete();
});
// Observer n°1
currentTime$.subscribe(currentTime => console.log("Current time (Observer 1): ", currentTime));
@hicglobalsolutions
hicglobalsolutions / Apex Controller Class
Created Sep 23, 2021
How to create a map in Apex using Salesforce LWC
View Apex Controller Class
public inherited sharing class LWCController {
LWCController() {
}
@AuraEnabled(cacheable=true)
public static map<integer, String> putMethod(integer key, String value) {
map<integer, String> mapOfValues = new map<integer, String>();
mapOfValues.put(1, 'Delhi');
mapOfValues.put(2, 'Noida');
mapOfValues.put(3, 'Gurugram');
mapOfValues.put(key, value);
View quadmesh_2d_topopt.py
from dolfin import *
import matplotlib.pyplot as plt
import numpy as np
import mshr
import math
# Algorithmic parameters
niternp = 20 # number of non-penalized iterations
niter = 100 # total number of iterations
pmax = 4 # maximum SIMP exponent
@kostas-artware
kostas-artware / functions.php
Created Sep 23, 2021
Add a checkbox with a fee in woocomerce checkoute page.
View functions.php
add_action( 'woocommerce_after_checkout_billing_form', 'add_box_option_to_checkout' );
function add_box_option_to_checkout( $checkout ) {
echo '<div id="message_fields">';
woocommerce_form_field( 'add_gift_box', array(
'type' => 'checkbox',
'class' => array('add_gift_box form-row-wide'),
'label' => __('Ilość pudełek ozdobnych - 25 PLN/szt'),
'placeholder' => __(''),
), $checkout->get_value( 'add_gift_box' ));
View file1.txt
String file contents
View file1.txt
String file contents