Skip to content

Instantly share code, notes, and snippets.

@simibac
simibac / currencies.json
Last active May 4, 2024 21:00
global currencies as list and sql script (157 currencies)
[
{
"code": "EUR",
"name": "Euro",
"name_plural": "euros",
"symbol": "",
"symbol_native": "",
"decimal_digits": 2,
"rounding": 0
},
@ihrke
ihrke / mclapply_expand_grid.R
Created May 31, 2017 14:52
how to use (mc)lapply together with expand.grid
library(tidyverse)
effs=seq(0, 1.0, by=0.05) # effect-sizes for which to calculate the design
rscales=c(sqrt(2)/2, 1, sqrt(2))
pars <- expand.grid(effs, rscales) %>% setNames(c("eff", "rscale"))
pars
lapply(data.frame(t(pars)), function(x) print(x))
@zerobugs-oficial
zerobugs-oficial / select2_example.html
Created June 23, 2020 00:42
Exemplo de implementação simples do select2 para uma caixa selectora dos estados do Brasil
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-beta.1/dist/css/select2.min.css" rel="stylesheet" />
<script src="https://code.jquery.com/jquery-3.5.1.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-beta.1/dist/js/select2.min.js"></script>
</head>
@ollieread
ollieread / readme.md
Last active May 4, 2024 20:56
Idea for generic dependency-injection attributes for PHP

You could provide a number of generic and agnostic attributes for use with dependency-injection solutions without enforcing any sort of contract or implementing structure. This would be achieved by only targetting things that we know will be used. These attributes could be used with auto-wiring or a compilation state that collects all the data for production deployment or something.

These attributes:

  • Wouldn't enforce a particular implementation
  • Wouldn't restrict the usage of the class
  • Wouldn't even require DI.

Binding

Free O'Reilly books and convenient script to just download them.

Thanks /u/FallenAege/ and /u/ShPavel/ from this Reddit post

How to use:

  1. Take the download.sh file and put it into a directory where you want the files to be saved.
  2. cd into the directory and make sure that it has executable permissions (chmod +x download.sh should do it)
  3. Run ./download.sh and wee there it goes. Also if you do not want all the files, just simply comment the ones you do not want.
@ShinyObjectLabs
ShinyObjectLabs / BaseForm.tsx
Last active May 4, 2024 20:53
Framer Form Component
/*
MIT License
Copyright © Joel Whitaker
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@fabzter
fabzter / beginners_ubuntu.md
Created February 9, 2023 11:34 — forked from bkanhu/beginners_ubuntu.md
A Beginners Guide on Things To Do After Installing Ubuntu.

Beginners Ubuntu

A Beginners Guide To Things To Do After Installing Ubuntu.

1. Check For Updates

sudo apt update && sudo apt upgrade

2. Enable additional repositories for more software

Ubuntu has several repositories from where it provides software for your system. Enabling all these repositories will give you access to more software and proprietary drivers.

@sam016
sam016 / AllGattCharacteristics.java
Last active May 4, 2024 20:46
Bluetooth GATT Services & Characteristics
package com.sam016.vsflatomation.service.ble;
import java.util.HashMap;
import java.util.UUID;
public class AllGattCharacteristics {
private static HashMap<String, String> attributes = new HashMap();
static {
attributes.put("00002a00-0000-1000-8000-00805f9b34fb", "Device Name");
@wojteklu
wojteklu / clean_code.md
Last active May 4, 2024 20:43
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules