Skip to content

Instantly share code, notes, and snippets.

@ahmadshobirin
ahmadshobirin / set locale and timezone indonesia in laravel.md
Last active April 18, 2024 11:50
set locale and timezone indonesia in laravel

Open File App\Providers\AppServiceProvider

Change method boot

use Carbon\Carbon;


public function boot()
{
	config(['app.locale' => 'id']);
@rubencaro
rubencaro / README.md
Last active April 18, 2024 11:47
Python installation guide

Python installation guide

These are my notes, not a generic solution. They are not meant to work anywhere outside my machines. Update version numbers to whatever are the current ones while you do this.

Install asdf and its python plugin, then install Python

asdf lives in https://github.com/asdf-vm/asdf

Follow its installation instructions, which at the moment of writing were:

@lmas
lmas / icmp_ping.go
Last active April 18, 2024 11:45
Simple utility package to send ICMP pings with Go
// Copyright © 2016 Alex
//
// This program is free software: you can redistribute it and/or modify it under
// the terms of the GNU Affero General Public License as published by the Free
// Software Foundation, either version 3 of the License, or (at your option) any
// later version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
// FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
@sming
sming / export-google-keep.py
Last active April 18, 2024 11:44
Simple script that exports Google Keep notes to a file called export-google-keep.py in the current directory
import keyring
import gkeepapi
################################################################
# Simple script that exports Google Keep notes to a file called
# export-google-keep.py in the current directory. A note will
# look like this:
# Hearthstone want list 2,☑ Aggro Druid common’s : Mark of the Lotus, power of the wild
# Rogue eviscerate, cold blood,
#
@udf
udf / write_up.md
Last active April 18, 2024 11:44
A Trick To Use mkMerge at The Top Level of a NixOS module

The Setup

I wanted to write a module that generates multiple systemd services and timers to scrub some zfs pools at certain intervals. The default scrub config does not support individual scrub intervals for each pool.

I want the config to look like this:

{
  services.zfs-auto-scrub = {
 tank = "Sat *-*-* 00:00:00";
@ndbroadbent
ndbroadbent / rn-i18n-locale-identifiers.csv
Last active April 18, 2024 11:43 — forked from JaseHadd/ioslocaleidentifiers.csv
React Native i18n Locale Identifiers
Locale Identifier Description
af Afrikaans
af-NA Afrikaans (Namibia)
af-ZA Afrikaans (South Africa)
agq Aghem
agq-CM Aghem (Cameroon)
ak Akan
ak-GH Akan (Ghana)
am Amharic
am-ET Amharic (Ethiopia)
@shakhmehedi
shakhmehedi / bash_backup_all_mysql_databases.sh
Created September 2, 2016 19:00
Bash scripts to backup all databases in a MySQL server with the option to exclude some databases.
#!/usr/bin/env bash
#This script backups selected databases in local MySQL server
#REQUIREMENTS
##mysqldump gzip
##mysql database has no root password. This script uses 'root' MySQL user without password as no 'root' password is set.
##This is not good practice. User with more restrictive permission should be used.
#set database user
@mosquito
mosquito / README.md
Last active April 18, 2024 11:43
Add doker-compose as a systemd unit

Docker compose as a systemd unit

Create file /etc/systemd/system/docker-compose@.service. SystemD calling binaries using an absolute path. In my case is prefixed by /usr/local/bin, you should use paths specific for your environment.

[Unit]
Description=%i service with docker compose
PartOf=docker.service
After=docker.service
@ElioLopez
ElioLopez / Grundstoff.md
Last active April 18, 2024 11:41 — forked from ShkurtiA/drugs_and_alcohol.md
Fahrschule, driving license germany, berlin

While driving on the motorway you overtake several vehicles. A vehicle approaches you from behind with indicators and headlights flashing. What should you do?

  • I brake briefly to prompt the vehicle behind to keep its distance
  • I continue driving until I can again pull into the right-hand lane
  • I turn on my hazard lights briefly to urge the vehicle behind to keep its distance

When must you switch on the hazard lights on your vehicle? If my vehicle

  • is being towed
  • experiences a breakdown at a place where the view is obscured
  • is briefly double-parked by me
@talwai
talwai / servefile.sh
Created January 23, 2015 19:57
One-shot HTTP webserver to serve file contents using netcat
{ echo -ne "HTTP/1.0 200 OK\r\nContent-Length: $(wc -c <some.file)\r\n\r\n"; cat some.file; } | nc -l 8080