Skip to content

Instantly share code, notes, and snippets.

View SMontiel's full-sized avatar

Salvador Montiel SMontiel

View GitHub Profile

Keybase proof

I hereby claim:

  • I am smontiel on github.
  • I am smontiel (https://keybase.io/smontiel) on keybase.
  • I have a public key ASBwsTZF1x_9Q4t6SfDGe2XOQXSGYrKvEPhNYHcX10Wm7Qo

To claim this, I am signing this object:

@keyframes dark-mode-icon-in {
0% { transform: rotate(90deg); }
100% { transform: rotate(0deg); }
}
@keyframes dark-mode-icon-out {
0% { transform: rotate(0deg); }
100% { transform: rotate(-90deg); }
}
import java.util.ArrayList;
import java.util.List;
public class Test {
public static void main(String[] args) {
String input = "the quick brown fox jumps over the lazy dog\n" +
"Mi nombre es Salvador Montiel";
String input2 = "the quick brownred fox jumps over the lazy dog\n";
wordWrapping(input, 15).forEach(line -> {
@SMontiel
SMontiel / switch-svg.html
Last active March 10, 2020 04:38
Switch with SVG and AlpineJS
<label x-data="{ open: true }" for="switch" class="mt-8 flex items-center">
<input id="switch" name="switch" type="checkbox" x-model="open" class="hidden">
<svg x-on:click="open = !open" class="text-orange-500 mr-2" width="40" height="24" aria-hidden="true">
<rect x="4" y="4" width="32" height="16" rx="8" x-bind:fill="open ? 'currentColor' : 'gray'"></rect>
<circle x-bind:cx="open ? '28' : '12'" cy="12" r="6" fill="white"></circle>
<rect x="1" y="1" width="38" height="22" rx="11" fill="none" stroke="currentColor" stroke-width="2"></rect>
</svg>
Switch
</label>
@SMontiel
SMontiel / AccountDropdown.vue
Created November 29, 2019 19:44
responsive-navbar-with-dropdown-vue
<template>
<div class="relative">
<button @click="isOpen = !isOpen" class="relative z-10 block w-10 h-10 rounded-full overflow-hidden border-2 border-gray-600 focus:outline-none focus:border-white">
<img class="w-full h-full object-cover" src="https://images.unsplash.com/photo-1487412720507-e7ab37603c6f?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=256&q=80" alt="Your avatar">
</button>
<button v-if="isOpen" @click="isOpen = false" tabindex="-1" class="fixed inset-0 w-full h-full cursor-default"></button>
<div v-if="isOpen" class="absolute right-0 w-48 mt-1 py-2 bg-white rounded-lg shadow-md">
<p class="block px-4 pb-2 text-gray-800 text-lg font-semibold border-b">{{ this.username }}</p>
<a href="#" class="block px-4 mt-0 py-2 text-gray-800 hover:bg-secondary-600 hover:text-white">Account settings</a>
<a :href="logoutRoute" class="block px-4 py-2 text-gray-800 hover:bg-secondary-600 hover:text-white"
<div class="h-screen bg-gray-500 flex flex-col">
<div class="h-16 bg-green-500 sticky top-0 z-10">
@yield('header')
</div>
<div class="flex-grow h-full">
<div class="flex bg-red-500 w-full h-full">
<div class="h-full left-0 top-0 lg:w-1/6 overflow-y-auto sticky bg-red-500">
@yield('sidebar')
</div>
<div class="flex-grow lg:w-5/6 bg-gray-600">
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="your.package.name" >
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<application
android:allowBackup="true"
@SMontiel
SMontiel / GridInsetDecoration.java
Created October 2, 2015 15:09 — forked from UweTrottmann/GridInsetDecoration.java
RecyclerView grid spacing decoration for use with GridLayoutManager.
/*
* Copyright 2015 Uwe Trottmann
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@SMontiel
SMontiel / json_class.java
Created October 1, 2015 22:43 — forked from zvineyard/json_class.java
Java: Get JSON from URL (Android)
public class Json {
public static JSONObject getJson(String url){
InputStream is = null;
String result = "";
JSONObject jsonObject = null;
// HTTP
try {
import android.text.TextUtils;
import java.io.UnsupportedEncodingException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.List;
/**
* @author Miguel Catalan Bañuls