Skip to content

Instantly share code, notes, and snippets.

@andreaseriksson
andreaseriksson / bootstrap_navbar_in_tailwind.html
Created December 4, 2019 19:14
Create a Bootstrap navbar with Tailwind CSS
<nav class="fixed top-0 right-0 left-0 z-40 flex flex-wrap sm:flex-row items-center justify-between sm:justify-start py-1 px-4 bg-gray-900">
<a class="inline-block py-1 mr-4 text-xl text-gray-100 hover:text-gray-100" href="#">Fixed navbar</a>
<button class="inline-block py-1 px-3 leading-none bg-transparent border border-transparent rounded text-gray-500 border-gray-700 sm:hidden" type="button" data-toggle="collapse" data-target="#navbarCollapse">
<span class="navbar-toggler-icon inline-block w-6 h-6 align-middle bg-center bg-no-repeat"></span>
</button>
<div class="collapse navbar-collapse hidden w-full flex-grow items-center sm:flex sm:w-auto" id="navbarCollapse">
<ul class="flex flex-col pl-0 mb-0 list-none mr-auto sm:flex-row">
<li>
<a class="text-gray-200 hover:text-gray-500 sm:px-2" href="#">Home <span class="sr-only">(current)</span></a>
</li>
@kenji4569
kenji4569 / ulid_converter.sql
Last active June 3, 2024 06:02
ULID (26 characters in Crockford's base32) conversion for MySQL function
# Define ULID_DECODE and ULID_ENCODE which convert a ulid string to a binary and vice versa.
delimiter //
DROP FUNCTION IF EXISTS ULID_DECODE//
CREATE FUNCTION ULID_DECODE (s CHAR(26)) RETURNS BINARY(16) DETERMINISTIC
BEGIN
DECLARE s_base32 CHAR(26);
SET s_base32 = REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(UPPER(s), 'J', 'I'), 'K', 'J'), 'M', 'K'), 'N', 'L'), 'P', 'M'), 'Q', 'N'), 'R', 'O'), 'S', 'P'), 'T', 'Q'), 'V', 'R'), 'W', 'S'), 'X', 'T'), 'Y', 'U'), 'Z', 'V');
RETURN UNHEX(CONCAT(LPAD(CONV(SUBSTRING(s_base32, 1, 2), 32, 16), 2, '0'), LPAD(CONV(SUBSTRING(s_base32, 3, 12), 32, 16), 15, '0'), LPAD(CONV(SUBSTRING(s_base32, 15, 12), 32, 16), 15, '0')));
END//
@v3n3
v3n3 / ffmpeg-android
Created September 9, 2016 15:10
build ffmpeg for android in multiple CPU architecture
#!/bin/bash
# Don't forget to install yasm.
set -e
# Set your own NDK here
NDK=~/Library/Android/sdk/ndk-bundle
ARM_PLATFORM=$NDK/platforms/android-23/arch-arm/
@greenido
greenido / gce-vpn-install.sh
Last active March 31, 2022 14:11
Installing vpn on GCE
#!/bin/sh
#
# Automatic configuration of a VPN on GCE debian-7-wheezy server.
# Tested only on debian-7-wheezy.
#
# This work is licensed under the Creative Commons Attribution-ShareAlike 3.0
# Unported License: http://creativecommons.org/licenses/by-sa/3.0/
#
# Thx to: https://github.com/sarfata/voodooprivacy/blob/master/voodoo-vpn.sh for the code/idea
#
@riley-dog
riley-dog / build.gradle
Last active March 7, 2020 15:01
Adding google api to build.gradle file in android studio
// After reading this shit
//http://www.gradle.org/docs/1.9/userguide/userguide_single.html#N10565
// And some of this shit
// https://code.google.com/p/google-http-java-client/wiki/Setup
// And of course guessing what the dependency package is named
// I was able to use Gradle and see its awesomeness after adding my dependenices to build.gradle in Android Studio
compile('com.google.api-client:google-api-client-android:1.17.0-rc') {