Skip to content

Instantly share code, notes, and snippets.

View httpsterio's full-sized avatar
delete this pls

Sami Mäkelä httpsterio

delete this pls
View GitHub Profile
@httpsterio
httpsterio / linux.sh
Created January 23, 2021 03:23
linux setup commands
# WLAN POWER SAVE
# check network card name with ip addr
iw wlp3s0f0 set power_save off
# CASE INSENSITIVE TAB COMPLETION
if [ ! -a ~/.inputrc ]; then echo '$include /etc/inputrc' > ~/.inputrc; fi
echo 'set completion-ignore-case On' >> ~/.inputrc
#!/bin/bash
#
# Asettaa Netlifyssa A-recordin koneen nykyisellä ulkoisella ip:llä. Dependency ainoastaan jq.
# Tarvitsee argumentteina access tokenin (https://app.netlify.com/applications), verkko-osoitteen, aliosoitteen ja vanhenemisajan minuutteina.
# esim: ./netlify-dynamicdns.sh $AccessToken $Domain $Subdomain $TTL
#
if [ "$#" -ne 4 ]; then
echo "Wrong number of parameters passed"
echo "Usage:"
echo "$0 <ACCESS_TOKEN> <DOMAIN> <SUBDOMAIN> <TTL>"
#!/bin/bash
#
# This is a script to update a Netlify subdomain A record with the current external IP.
# The example below would update the local.example.com A record to the current external IP with a TTL of 5 minutes.
# Copied from https://blog.skylerlewis.io/2020/12/diy-dynamic-dns-using-netlify-api.html
#
# Usage:
# netlify-ddns.sh <ACCESS_TOKEN> <DOMAIN> <SUBDOMAIN> <TTL>
#
# Example:
const articleImages = [...document.querySelectorAll("main article img")];
if (articleImages.length) {
articleImages.forEach((image) => {
// If an image has a title it means that the user added a caption
// so replace the image with a figure containing that image and a caption
if (image.hasAttribute("title")) {
const figure = document.createElement("figure");
const figCaption = document.createElement("figcaption");
figCaption.innerHTML = image.getAttribute("title");
using System;
using System.Collections.Generic;
using Jypeli;
using Jypeli.Assets;
using Jypeli.Controls;
using Jypeli.Widgets;
public class T6_hiiripallo : PhysicsGame
{
public override void Begin()
@httpsterio
httpsterio / lahinpallo.cs
Created February 27, 2020 20:31
LahinPallo
using System;
using System.Collections.Generic;
using Jypeli;
using Jypeli.Assets;
using Jypeli.Controls;
using Jypeli.Widgets;
public class T4_5_LahinPallo : PhysicsGame
{
public override void Begin()
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
public class t3_4_miidi
{
public static void Main()
{
//double[] luvut = {-1, -2, -3, 2, 5, -10}; // keskiarvo == 0.2
/// <summary>
///
/// </summary>
double r = 10;
public override void Begin()
{
Camera.ZoomToLevel();
Level.Background.Color = Color.Black;
Lumipallo(0,0);
Lumipallo(-50, 200);
@httpsterio
httpsterio / copypath_copycontent.sh
Last active April 26, 2018 09:55
A few handy bash commands I created for my own needs.
cpath () {
pwd > ~/.pathfile
echo 'path copied'
}
ppath () {
cd $(cat ~/.pathfile)
}
cfile () {
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// Choose either "stable" for receiving highly polished,
// or "canary" for less polished but more frequent updates
updateChannel: 'stable',