Discover gists
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# --slave /usr/bin/$1 $1 /usr/bin/$1-\${version} \\ | |
function register_clang_version { | |
local version=$1 | |
local priority=$2 | |
update-alternatives \ | |
--install /usr/bin/llvm-config llvm-config /usr/bin/llvm-config-${version} ${priority} \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Comandos do git | |
git commit -m"contaúdo da mensagem de commit": Gravação de arquivo no git. Esse comando serve para commitar os arquivos no git. | |
O "-m" é referete ao termo "mensseger". Ou seja, mensagem que será gravada no commit. | |
ctrl + l = É o comando que limpa a tela do terminal do git. | |
git log: Comando para visualizar os logs dos arquivos gravados no repositório. | |
git remote add origin + endereço da pasta no github: Esse comando permite apontar para o repositório no github. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- bezier curve drawing functions for playdate lua | |
-- these are based on de Casteljau's algorithm | |
-- this site has a nice interactive demo to compare both types of curve: https://pomax.github.io/bezierinfo/#flattening | |
-- draws a curve starting at x1,y1, ending at x3,y3, with x2,y2 being a control point that "pulls" the curve towards it | |
-- steps is the number of line segments to use, lower is better for performance, higher makes your curve look smoother | |
-- the playdate is kinda slow, so it's recommended to find a relatively low step number that looks passable enough! | |
function drawQuadraticBezier(x1, y1, x2, y2, x3, y3, steps) | |
steps = steps or 8 | |
local d = 1 / steps |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<section id="services" class="services"> | |
<div class="container"> | |
<div class="section-title aos-init aos-animate" data-aos="fade-up"> | |
<h2><strong></strong></h2> | |
</div> | |
<div class="row"> | |
<div class="col-lg-4 col-md-6"> | |
<div class="icon-box aos-init aos-animate" data-aos="fade-up" data-aos-delay="400"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
don't forget to add in app gradle: | |
compile 'com.squareup.retrofit2:retrofit:2.3.0' | |
and add INTERNET permission to AndroidManifest | |
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
...> | |
<uses-permission android:name="android.permission.INTERNET" /> | |
<application... /> | |
/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# file: /usr/local/bin/kill_ports | |
PS3='Please enter your choice: ' | |
options=$(lsof -PiTCP -sTCP:LISTEN | awk '{print $9}' | sed -n '1!p') | |
RED='\033[0;31m' | |
NC='\033[0m' # No Color | |
select port in $options | |
do | |
echo "Selected character: $port" | |
echo "Selected number: $REPLY" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const sendJSON = async () => { | |
(async () => { | |
const rawResponse = await fetch("https://httpbin.org/post", { | |
method: "POST", | |
headers: { | |
Accept: "application/json", | |
"Content-Type": "application/json" | |
}, | |
body: JSON.stringify({ name: "Mannir", age: 23 }) | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const ref = firestore().collection('people') | |
.where("gender", "==", this.state.currentUser.genderPreferred) | |
.where('age', '>=', this.state.currentUser.minimumAgePreferred) | |
.where('age', '<=', this.state.currentUser.maximumAgePreferred) | |
.where('longitude', '<=', this.state.currentUser.longitude) // Example here, Haversine function... | |
// Potentially more conditions... | |
.orderBy('timeStamp') | |
.limit(100) | |
.onSnapshot(querySnapshot => { | |
let listUsers: User[] = []; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AWSTemplateFormatVersion: '2010-09-09' | |
Description: CloudFormation template for Flagsmith Platform | |
Parameters: | |
ApexDomain: | |
Description: The domain name for the Flagsmith Platform (e.g., "example.com") | |
Type: String | |
Default: example.com | |
StageName: | |
Description: The environment for the Flagsmith Platform (e.g., "prod") |
NewerOlder