Skip to content

Instantly share code, notes, and snippets.

@paraya3636
paraya3636 / KotlinAndroidMainApplication
Last active October 7, 2023 23:07
Kotlin Android MainApplication class for global applicationContext.
// Not object class. AndroidManifest.xml error happen.
class MainApplication : Application() {
init {
instance = this
}
companion object {
private var instance: MainApplication? = null
@cachapa
cachapa / gif_creator.sh
Last active April 1, 2022 12:07
Shell script to generate high-quality animated gifs from a video file
#!/bin/bash
# Based on http://blog.pkh.me/p/21-high-quality-gif-with-ffmpeg.html
# Requires ffmpeg
filename="${1%.*}"
palette="/tmp/palette.png"
filters="scale=320:-1:flags=lanczos"
ffmpeg -v warning -i "$1" -vf "$filters,palettegen" -y $palette
ffmpeg -v warning -i "$1" -i $palette -lavfi "$filters [x]; [x][1:v] paletteuse" -y "$filename.gif"
@davimacedo
davimacedo / curl.sh
Last active June 23, 2021 21:33
Example of importing data with cloud functions. See a live example at https://www.back4app.com/database/davimacedo/parse-import-example
curl -X POST \
-H "X-Parse-Application-Id: LL9oIdzIkmwl5xyowQQu0fTmXyUWfet9RuAzwHfj" \
-H "X-Parse-REST-API-Key: R3S8PYQKuzeV4c8MUeO5ved46C50MEp56boDHW1O" \
-H "Content-Type: application/json" \
-d @data.json \
https://parseapi.back4app.com/functions/import
@pangeaware
pangeaware / linkedinLogin.jsx
Created March 30, 2016 23:58
React Component Implementing the Linkedin Javascript SDK
var React = require('react');
var LinkedinLogin = React.createClass({
componentDidMount: function() {
var liRoot = document.createElement('div');
liRoot.id = 'linkedin-root';
document.body.appendChild(liRoot);
@flyingzl
flyingzl / package.json
Last active March 3, 2020 03:29
webpack config configurations on Windows
{
"name": "think-in-react",
"version": "1.0.0",
"description": "",
"main": "app.js",
"scripts": {
"dev": "webpack-dev-server --devtool source-maps --hot --progress --colors --content-base .",
"build": "set NODE_ENV=production&&webpack -pd"
},
"browserify": {
@cbeyls
cbeyls / RefreshProgressBar.java
Last active January 1, 2019 14:37
A custom horizontal indeterminate progress bar which displays a smooth colored animation. (Google Now progress bar)
package android.support.v4.widget;
import android.content.Context;
import android.graphics.Canvas;
import android.os.Handler;
import android.support.annotation.ColorInt;
import android.support.annotation.ColorRes;
import android.support.annotation.NonNull;
import android.support.v4.content.ContextCompat;
import android.util.AttributeSet;