Skip to content

Instantly share code, notes, and snippets.

View esodot's full-sized avatar

esodot esodot

  • Munich
  • 07:52 (UTC +02:00)
View GitHub Profile
@markmals
markmals / Wiggle.swift
Last active March 30, 2025 12:15
The iOS Home Screen wiggle animation, in SwiftUI
import SwiftUI
extension View {
func wiggling() -> some View {
modifier(WiggleModifier())
}
}
struct WiggleModifier: ViewModifier {
@State private var isWiggling = false
@rayfarer
rayfarer / script.js
Created April 1, 2018 15:47
Add Timestamp When Document Created Firestore
/*
Using Cloud Functions, here's what I've come up with for anyone who wants to
add a timestamp field in a Firestore document. You need to have the Firebase Admin SDK installed in
addition to the general setup for Cloud Functions as detailed in the Firebase documentation.
*/
const functions = require('firebase-functions');
// The Firebase Admin SDK to access the Firebase Realtime Database.
const admin = require('firebase-admin');
@GantMan
GantMan / Vehicle API Call.js
Last active October 2, 2018 13:04
Example API Tests for Star Wars API via Postman
// example testing:
// More found here: https://www.getpostman.com/docs/postman/scripts/test_examples
// TEST 1
pm.test("response is ok", () => {
pm.response.to.be.ok // enforce 200ish
// same as above pm.response.to.not.be.error
// HTTP good, but contents cannot say error
pm.response.to.not.have.jsonBody("error")
@likangwei
likangwei / AppOnlineUpdate.java
Last active October 29, 2015 09:57
Android Utils
package com.stonete.qrtoken.utils;
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
@gabrielemariotti
gabrielemariotti / README.md
Last active April 24, 2025 04:34
A SectionedGridRecyclerViewAdapter: use this class to realize a simple sectioned grid `RecyclerView.Adapter`.

You can use this class to realize a simple sectioned grid RecyclerView.Adapter without changing your code.

Screen

The RecyclerView has to use a GridLayoutManager.

This is a porting of the class SimpleSectionedListAdapter provided by Google

If you are looking for a sectioned list RecyclerView.Adapter you can take a look here

@ianribas
ianribas / gist:f76d20c21bb9f5c0df2f
Last active January 8, 2021 13:23
Elasticsearch problem with multi word query time synonyms and match queries with AND operator
#!/bin/bash
# delete old index if exists
curl -XDELETE 'http://localhost:9200/multiwordsyns?pretty'
# create index with synonym analyzer and mapping
curl -XPUT 'http://localhost:9200/multiwordsyns?pretty' -d '{
"settings" : {
"number_of_replicas": 0,
"number_of_shards": 1,
@terapyon
terapyon / sample.v4.vcl
Last active March 13, 2019 13:51
This file is a sample VCL for Varnish 4.0. It will be used a back-end Plone. And support purge.
#
# This is an example VCL file for Varnish.
#
# It does not do anything by default, delegating control to the
# builtin VCL. The builtin VCL is called when there is no explicit
# return statement.
#
# See the VCL chapters in the Users Guide at https://www.varnish-cache.org/docs/
# and http://varnish-cache.org/trac/wiki/VCLExamples for more examples.
@mattweber
mattweber / synstest.sh
Last active January 8, 2021 13:20
Multi-word query time synonyms in elasticsearch.
# delete old index if exists
curl -XDELETE 'http://localhost:9200/syns?pretty'
# create index with synonym analyzer and mapping
curl -XPUT 'http://localhost:9200/syns?pretty' -d '{
"settings" : {
"number_of_replicas": 0,
"number_of_shards": 1,
"index": {
"analysis": {
@adamantium
adamantium / SessionGraphActivity.java
Created November 16, 2012 07:17
Android achartengine Timeseries Graph Example
package com.nclab.CoMonTracker;
import java.io.File;
import java.io.FileInputStream;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Scanner;
import java.util.TreeMap;