Skip to content

Instantly share code, notes, and snippets.

View ktprezes's full-sized avatar

Tadeusz Kurpiel ktprezes

View GitHub Profile
@lqc
lqc / python_locale_sort_bug.py
Created November 26, 2009 01:35
Buggy locale sorting in python
# -*- coding: utf-8 -*-
from __future__ import print_function
import sys
import locale
locale.setlocale(locale.LC_ALL, '')
print("Python version:", sys.version_info)
print("LC_ALL =", locale.getlocale(locale.LC_ALL))
@awrowse
awrowse / html5_stub.html
Created February 16, 2012 15:14
HTML5 Page Stub
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Page Title</title>
<meta name="description" content="Webpage for xxxx">
<!-- http://meyerweb.com/eric/tools/css/reset/ -->
<link rel="stylesheet" href="css/reset/reset.css">
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js" type="text/javascript"></script>
@ikoblik
ikoblik / exif_date.py
Last active June 19, 2024 06:31
Python script to update image creation and modification dates to the EXIF date.
#!/usr/bin/env python
# MIT License
# Copyright (c) 2023 Ivan Koblik
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@rxaviers
rxaviers / gist:7360908
Last active July 22, 2024 11:10
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@uupaa
uupaa / image.resize.in.github.flavored.markdown.md
Last active July 11, 2024 16:08
image resize in github flavored markdown.

Image source

https://gyazo.com/eb5c5741b6a9a16c692170a41a49c858.png

Try resize it!

  • ![](https://gyazo.com/eb5c5741b6a9a16c692170a41a49c858.png | width=100)
@paulirish
paulirish / what-forces-layout.md
Last active July 22, 2024 06:32
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@jahe
jahe / spring-boot-cheatsheet.java
Last active May 25, 2024 03:47
Spring Boot Cheatsheet
// Enable component-scanning and auto-configuration with @SpringBootApplication Annotation
// It combines @Configuration + @ComponentScan + @EnableAutoConfiguration
@SpringBootApplication
public class FooApplication {
public static void main(String[] args) {
// Bootstrap the application
SpringApplication.run(FooApplication.class, args);
}
}
@asicfr
asicfr / TestClass.java
Created May 2, 2016 13:59
Properties and ResourceBundle from Xml file
package test;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
import java.util.ResourceBundle;
public class TestClass {
@kvnxiao
kvnxiao / awesome-java-sorted-2019-05-01.md
Last active January 20, 2021 13:47
awesome-java-sorted-2019-05-01.md
@kiwiandroiddev
kiwiandroiddev / CartesianProduct.kt
Created August 23, 2019 01:58
Kotlin function to return the cartesian product of two collections
/**
* E.g.
* cartesianProduct(listOf(1, 2, 3), listOf(true, false)) returns
* [(1, true), (1, false), (2, true), (2, false), (3, true), (3, false)]
*/
fun <T, U> cartesianProduct(c1: Collection<T>, c2: Collection<U>): List<Pair<T, U>> {
return c1.flatMap { lhsElem -> c2.map { rhsElem -> lhsElem to rhsElem } }
}