This Javascript will calculate a unique color for any English word typed into it. Currently other alphabets are not supported. Punctuation and white space are ignored.
A Pen by Matt Nicolaysen on CodePen.
This Javascript will calculate a unique color for any English word typed into it. Currently other alphabets are not supported. Punctuation and white space are ignored.
A Pen by Matt Nicolaysen on CodePen.
package com.tinmegali.daggerwithkotlin.room | |
import android.arch.lifecycle.LiveData | |
import android.arch.lifecycle.Observer | |
import java.util.concurrent.CountDownLatch | |
import java.util.concurrent.TimeUnit | |
// Extension to allow unit tests on LiveData | |
// discussion on: https://stackoverflow.com/questions/44270688/unit-testing-room-and-livedata |
'use strict'; | |
const crypto = require('crypto'); | |
const ENCRYPTION_KEY = process.env.ENCRYPTION_KEY; // Must be 256 bits (32 characters) | |
const IV_LENGTH = 16; // For AES, this is always 16 | |
function encrypt(text) { | |
let iv = crypto.randomBytes(IV_LENGTH); | |
let cipher = crypto.createCipheriv('aes-256-cbc', Buffer.from(ENCRYPTION_KEY), iv); |
#---- Generated by tint2conf 9757 ---- | |
# See https://gitlab.com/o9000/tint2/wikis/Configure for | |
# full documentation of the configuration options. | |
#------------------------------------- | |
# Backgrounds | |
# Background 1: Panel, Tooltip | |
rounded = 0 | |
border_width = 0 | |
border_sides = TBLR | |
background_color = #16161d 63 |
class RedditLink( | |
val author: String, | |
val likes: RedditLikes, | |
val title: String, | |
val score: Int | |
) | |
enum class RedditLikes { | |
UP, DOWN, NONE | |
} |
#!/bin/bash | |
# export DBUS_SESSION_BUS_ADDRESS environment variable because cron hates me | |
PID=$(pgrep -u USER gnome-session-b) | |
export DBUS_SESSION_BUS_ADDRESS=$(grep -z DBUS_SESSION_BUS_ADDRESS /proc/$PID/environ|cut -d= -f2-) | |
/usr/bin/gsettings set org.gnome.shell.extensions.user-theme name 'Flat-Plat' | |
/usr/bin/gsettings set org.gnome.desktop.interface gtk-theme 'Flat-Plat' | |
/usr/bin/gsettings set org.gnome.desktop.background picture-uri 'file://WALLPAPER-PATH' | |
/usr/bin/gsettings --schemadir ~/.local/share/gnome-shell/extensions/[email protected] set org.zzrough.gs-extensions.drop-down-terminal background-color 'rgb(69,90,100)' |
Putting cryptographic primitives together is a lot like putting a jigsaw puzzle together, where all the pieces are cut exactly the same way, but there is only one correct solution. Thankfully, there are some projects out there that are working hard to make sure developers are getting it right.
The following advice comes from years of research from leading security researchers, developers, and cryptographers. This Gist was [forked from Thomas Ptacek's Gist][1] to be more readable. Additions have been added from
/** | |
* Custom Scroll listener for RecyclerView. | |
* Based on implementation https://gist.github.com/ssinss/e06f12ef66c51252563e | |
*/ | |
public abstract class EndlessRecyclerOnScrollListener extends RecyclerView.OnScrollListener { | |
public static String TAG = "EndlessScrollListener"; | |
private int previousTotal = 0; // The total number of items in the dataset after the last load | |
private boolean loading = true; // True if we are still waiting for the last set of data to load. | |
private int visibleThreshold = 5; // The minimum amount of items to have below your current scroll position before loading more. |
import com.google.gson.JsonElement; | |
import com.google.gson.JsonObject; | |
import com.google.gson.JsonSerializationContext; | |
import com.google.gson.JsonSerializer; | |
import com.squareup.javapoet.*; | |
import javax.lang.model.element.Modifier; | |
import java.io.File; | |
import java.io.IOException; | |
import java.lang.reflect.Field; |
dropbox-puburl.sh
in the location of your choice (here ~/tools/bin/dropbox-puburl.sh
)dropbox-screenshot-puburl.desktop
into /usr/share/applications
(you need to be root)sudo update-desktop-database
Preferences > Actions > Open With
and select Dropbox copy public file URL to clipboard