Skip to content

Instantly share code, notes, and snippets.

@wrschneider
wrschneider / App.java
Last active April 22, 2023 16:27
Spring Boot listener for Amazon SQS
package bill.boottest;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.aws.messaging.listener.annotation.SqsListener;
import com.fasterxml.jackson.annotation.JsonCreator;
@GULPF
GULPF / stats.txt
Created April 28, 2018 22:05
Nim stdlib usage for top 1000 starred GitHub projects
Number of files that imports the module (~15000 files total)
1 oswalkdir
1 rstgen
1 ftpclient
1 distros
1 strmisc
2 rlocks
2 lenientops
2 unidecode
3 httpserver
@voluntas
voluntas / sysctl.conf
Created October 14, 2017 13:07 — forked from techgaun/sysctl.conf
Sysctl configuration for high performance
### KERNEL TUNING ###
# Increase size of file handles and inode cache
fs.file-max = 2097152
# Do less swapping
vm.swappiness = 10
vm.dirty_ratio = 60
vm.dirty_background_ratio = 2
@branneman
branneman / fp-lenses.js
Last active May 17, 2023 00:56
JavaScript: Lenses (Functional Programming)
// FP Lenses
const lens = get => set => ({ get, set });
const view = lens => obj => lens.get(obj);
const set = lens => val => obj => lens.set(val)(obj);
const over = lens => fn => obj => set(lens)(fn(view(lens)(obj)))(obj);
const lensProp = key => lens(prop(key))(assoc(key));
@codenoid
codenoid / matchmacro.nim
Created September 11, 2017 07:18 — forked from mashingan/matchmacro.nim
defining match syntax using Nim macro
import macros
macro match(head, body: untyped): untyped =
result = newNimNode nnkStmtList
var casenode = newNimNode nnkCaseStmt
casenode.add head
for node in body:
node.expectKind nnkInfix
@yasinkuyu
yasinkuyu / desiredcapabilities.py
Created September 8, 2017 14:07
Python Selenium Luminati Proxy Desired Capabilities (Exclude localhost)
#@yasinkuyu 08/09/2017
# install luminati (https://luminati.io) proxy manager & run
from selenium import webdriver
from selenium.webdriver.common.proxy import Proxy, ProxyType
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.proxy import *
PROXY = '127.0.0.1:24000'
@sloanlance
sloanlance / Editing remote files in Vim with SSH.md
Created July 13, 2017 16:11
Editing remote files in Vim with SSH

Editing remote files in Vim with SSH

  1. Configure SSH

    In ~/.ssh/config, include the lines:

    Host *
    ControlPath ~/.ssh/sockets/%r@%h-%p
    
@romainl
romainl / colorscheme-override.md
Last active November 9, 2024 21:05
The right way to override any highlighting if you don't want to edit the colorscheme file directly

The right way to override any highlighting if you don't want to edit the colorscheme file directly

Generalities first

Suppose you have weird taste and you absolutely want:

  • your visual selection to always have a green background and black foreground,
  • your active statusline to always have a white background and red foreground,
  • your very own deep blue background.
@stisa
stisa / jspromises.nim
Created May 13, 2017 12:20
JS promises wrapper for nim
import jsffi
type Promise*[T] = ref object of JsObject
proc newPromise*[T](executor:proc(resolve:proc(val:T), reject:proc(reason:auto))): Promise[T] {.importcpp: "new Promise(#)".}
proc resolve*[T](val:T):Promise[T] {.importcpp: "Promise.resolve(#)",discardable.}
proc reject*[T](reason:T):Promise[T] {.importcpp: "Promise.reject(#)",discardable.}
proc race*[T](iterable:openarray[T]):Promise[T] {.importcpp: "Promise.race(#)",discardable.}
proc all*[T](iterable:openarray[Promise[T]]):Promise[seq[T]] {.importcpp: "Promise.all(#)",discardable.}
@zacharycarter
zacharycarter / wclwn.md
Last active August 19, 2024 03:44
Binding to C Libraries with Nim