Skip to content

Instantly share code, notes, and snippets.

View recover-return-value
package main
import "fmt"
func main() {
s := foo()
fmt.Printf("main received: %q\n", s)
}
func foo() string {
@chaua
chaua / colors.xml
Created Jun 25, 2022
Android colors.xml file including all Material Design color definitions.
View colors.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="black">#000000</color>
<color name="white">#ffffff</color>
<color name="grey_50">#FAFAFA</color>
<color name="grey_100">#F5F5F5</color>
<color name="grey_200">#EEEEEE</color>
<color name="grey_300">#E0E0E0</color>
View LogsFileProviderDaily
class LogsFileProviderDaily @Inject constructor() : LogsFileProvider {
private val TAG = LogsFileProvider::class.simpleName!!
private val folderNameFormat = SimpleDateFormat("dd_MM_yyyy", Locale.getDefault())
override suspend fun provideLogsDirectory(appContext: Context) =
File(("${appContext.filesDir}/${appContext.getString(R.string.logsDirectoryName)}"))
override suspend fun provideFile(appContext: Context): File? {
val fileName = folderNameFormat.format(Calendar.getInstance().time)
View appscriptUtil.js
// check if we are inside GAS
function InGas() {
return typeof ScriptApp !== 'undefined';
}
@mrts
mrts / list-digitalocean-spaces-content.py
Created Jun 25, 2022
List all DigitalOcean Spaces files with Python
View list-digitalocean-spaces-content.py
import boto3
ENDPOINT_URL = 'https://fra1.digitaloceanspaces.com'
SPACE = "space-name"
REGION = "FRA1"
ACCESS_KEY_ID = "..."
SECRET_ACCESS_KEY = "..."
def main():
session = boto3.session.Session()
View submit.csv
PassengerId Survived
892 0
893 1
894 0
895 0
896 1
897 0
898 1
899 0
900 1
View gist:6c55cb294b14bafa8e3cbdc78bb97d1c
void main()
{
//data.type data.address = value;
//class.name object.name = class.name();
Cars Caddy = Cars(
brand: "VW",
model: "Caddy",
color: 'black',
);
Cars Jetta = Cars(
@mzarrinpour
mzarrinpour / pptpinstall.sh
Last active Jun 25, 2022 — forked from asimzeeshan/pptpinstall.sh
Install PPTP vpn server on Xen Ubuntu
View pptpinstall.sh
#!/bin/bash
# Interactive PoPToP install script on a OpenVZ VPS
# Tested on Debian 5, 6, and Ubuntu 11.04
# 2011 v1.1
# Author: Commander Waffles
# http://www.putdispenserhere.com/pptp-debian-ubuntu-openvz-setup-script/
#
# Serverd by: Asim Zeeshan via Gist
# https://gist.github.com/3799210
@chathuranga88
chathuranga88 / Readme.md
Created Jun 25, 2022
This is Java Version
View Readme.md

Hello World

View Dockerfile
FROM archlinux:base-devel
LABEL org.opencontainers.image.authors="avatar@arkane-systems.net"
RUN pacman -Syu --noconfirm pacman-contrib git
# makepkg user and workdir
ARG pkguser=makepkg
RUN useradd --system --create-home $pkguser \
&& echo "$pkguser ALL=(ALL:ALL) NOPASSWD:ALL" > /etc/sudoers.d/$pkguser