Skip to content

Instantly share code, notes, and snippets.

View alexstyl's full-sized avatar

Alex Styl alexstyl

View GitHub Profile
@JakeWharton
JakeWharton / build.gradle
Created July 19, 2014 00:17
Adding support-annotations jar to a Java module.
apply plugin: 'java'
sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7
def logger = new com.android.build.gradle.internal.LoggerWrapper(project.logger)
def sdkHandler = new com.android.build.gradle.internal.SdkHandler(project, logger)
for (File file : sdkHandler.sdkLoader.repositories) {
project.repositories.maven {
url = file.toURI()
@charbgr
charbgr / record-gif.sh
Last active October 26, 2016 13:52
Android - Gif Recording Device
#!/bin/bash
adb shell screenrecord --bit-rate=20M "/sdcard/recording.mp4" &
PID=$!
echo "Recording.. ($PID)"
read -n1 -r -p "Press any key to stop" key
kill -SIGHUP $PID
sleep 1
adb pull "/sdcard/recording.mp4"
echo "Gififying..."
gifify -r 60 "recording.mp4"
@pchrysa
pchrysa / index.js
Last active February 10, 2017 10:27
Scrape with Cheerio
var fs = require('fs');
var request = require('sync-request');
var cheerio = require('cheerio');
var _ = require('lodash');
const months = ['gennaio', 'febbraio', 'marzo', 'aprile', 'maggio', 'giugno', 'luglio', 'agosto', 'settembre', 'ottobre', 'novembre', 'dicembre'];
var dates = [];
const url = 'http://m.paginainizio.com/onomasticimob.php?mese=';
for (var m in months) {
@dideler
dideler / bot.rb
Last active May 23, 2024 17:31
Sending a notification message to Telegram using its HTTP API via cURL
# Use this script to test that your Telegram bot works.
#
# Install the dependency
#
# $ gem install telegram_bot
#
# Run the bot
#
# $ ruby bot.rb
#
@evdama
evdama / tailwind.css
Created August 4, 2019 11:04
tailwind colors for light and dark theme via CSS variables
@import "tailwindcss/base";
@import "tailwindcss/components";
@import './components';
@import "tailwindcss/utilities";
@import './edm-utilities';
:root {
--font-family-one: Montserrat, sans-serif;
--font-family-two: Roboto, sans-serif;
<?
# MIT license, do whatever you want with it
#
# This is my invoice.php page which I use to make invoices that customers want,
# with their address on it and which are easily printable. I love Stripe but
# their invoices and receipts were too wild for my customers on Remote OK
#
require_once(__DIR__.'/../vendor/autoload.php');
@watabee
watabee / android-demo-mode.zsh
Last active November 6, 2023 09:28
Enter or exit demo mode for the Android System UI
function android-demo-mode() {
CMD=$1
if [[ $CMD != "on" && $CMD != "off" ]]; then
echo "Usage: $0 [on|off] [hhmm]" >&2
return 1
fi
if [[ "$2" != "" ]]; then
HHMM="$2"
@c5inco
c5inco / CollapsingTabBar.kt
Last active August 17, 2022 00:05
Jetpack Compose implementation of inspirational design https://twitter.com/philipcdavis/status/1486871621600104450
package des.c5inco.material3
import androidx.compose.animation.*
import androidx.compose.animation.core.*
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.foundation.shape.RoundedCornerShape
@alexstyl
alexstyl / SafeContent.kt
Last active May 5, 2022 07:33
A Composable that will keep push its content so that they are not drawn behind the system bars. This is useful for when you want to work on a layout without having to worry about insets.
@Composable
fun SafeContent(
systemBarsColor: Color = Color(0xFF082A3A),
content: @Composable () -> Unit
) {
Box(
modifier = Modifier
.background(systemBarsColor)
.systemBarsPadding()
.background(MaterialTheme.colors.background)
@rock3r
rock3r / .gitignore
Last active April 13, 2024 12:52
A template .gitignore for Kotlin projects using Gradle (with additional content for Android projects)
## Seb's .gitignore template
# You can find the most up-to-date version at https://go.sebastiano.dev/gitignore
# Partly based on templates by https://plugins.jetbrains.com/plugin/7495--ignore
# Released under a CC-0 License https://creativecommons.org/share-your-work/public-domain/cc0/
### Windows template
# Windows thumbnail cache files
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db