Skip to content

Instantly share code, notes, and snippets.

View andrask's full-sized avatar

Andras Kovi andrask

  • Budapest, Hungary
View GitHub Profile
<script>
// Based on code from https://stackoverflow.com/questions/59629947/how-do-i-load-an-external-js-library-in-svelte-sapper
import { onMount, createEventDispatcher } from "svelte";
const dispatch = createEventDispatcher();
export let src;
export let libraryDetectionObject;
let script;
onMount(() => {
@adsr303
adsr303 / gimp-whiteboard.md
Last active September 29, 2023 14:56
Clean-up a whiteboard photo with GIMP

How to clean up a whiteboard photo using GIMP

Skipping other possible actions, such as perspective corrections, here is how:

  1. Duplicate the base image layer.
  2. Set the new layer's mode to "Divide".
  3. Apply a Gaussian blur with a radius of about 50 (Filters/Blur/Gaussian Blur...).

If you need to manipulate the resulting image further, create a new layer from visible (Layer/New from Visible).

@simonw
simonw / wget.md
Created December 9, 2016 06:38
Recursive wget ignoring robots
$ wget -e robots=off -r -np 'http://example.com/folder/'
  • -e robots=off causes it to ignore robots.txt for that domain
  • -r makes it recursive
  • -np = no parents, so it doesn't follow links up to the parent folder
@pokk
pokk / README.md
Last active July 23, 2018 06:59
Redirect file stdin in PyCharm

Introduction

For Pycharm IDE, we want to use redirect input file while running the code.

How to Use

  1. You can make a file for a input data as like *.in.
  2. Typing auto_redirect_input_file.py in top of code.
  3. Click the "Edit Configuration".
  4. Put the file name *.in in "Script parameters".
@wtcross
wtcross / provision-instance.yml
Created June 14, 2016 15:01
Example of an Ansible playbook that interacts with OpenStack. It is runnable via Ansible and Ansible Tower.
```yaml
- name: Provision a compute instance
hosts: localhost
gather_facts: no
become: no
vars:
os_config_file: "{{ lookup('env', 'OS_CLIENT_CONFIG_FILE') }}"
os_auth:
project_name: "{{ lookup('env', 'OS_PROJECT') }}"
auth_url: "{{ lookup('env', 'OS_AUTH_URL') }}"
@Faheetah
Faheetah / Jenkinsfile.groovy
Last active March 6, 2024 18:14
Jenkinsfile idiosynchrasies with escaping and quotes
node {
echo 'Results included as an inline comment exactly how they are returned as of Jenkins 2.121, with $BUILD_NUMBER = 1'
echo 'No quotes, pipeline command in single quotes'
sh 'echo $BUILD_NUMBER' // 1
echo 'Double quotes are silently dropped'
sh 'echo "$BUILD_NUMBER"' // 1
echo 'Even escaped with a single backslash they are dropped'
sh 'echo \"$BUILD_NUMBER\"' // 1
echo 'Using two backslashes, the quotes are preserved'
sh 'echo \\"$BUILD_NUMBER\\"' // "1"
@tinkertims
tinkertims / install_byobu_on_centos7.sh
Last active February 26, 2024 05:44
Install byobu to CentOS 7
wget http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm
rpm -ivh epel-release-7-5.noarch.rpm
sudo yum install byobu -y --enablerepo=epel-testing
@giefferre
giefferre / remote-rsyslog.go
Created March 31, 2015 23:16
Using a remote rsyslog in Golang
package main
import (
"log"
"log/syslog"
)
func main() {
logwriter, e := syslog.Dial("tcp","123.123.123.123:12345", syslog.LOG_DEBUG, "your.software.identifier")
if e != nil {
@soheilhy
soheilhy / nginxproxy.md
Last active March 22, 2024 08:54
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

/**
Provides the ability to verify key paths at compile time.
If "keyPath" does not exist, a compile-time error will be generated.
Example:
// Verifies "isFinished" exists on "operation".
NSString *key = SQKeyPath(operation, isFinished);
// Verifies "isFinished" exists on self.