Skip to content

Instantly share code, notes, and snippets.

@pbojinov
pbojinov / App.js
Created May 3, 2016 00:25
React Native App with Deep Link Support
import React, { View, Text, Linking } from 'react-native';
import urlParse from 'url-parse';
class App extends Component {
componentDidMount() {
// Handling Deep Linking
const deepLinkUrl = Linking.getInitialURL().then((url) => {
console.log(`Deep Link URL: ${url}`);
if (url) {
const parsedUrl = urlParse(url, true);
@jubalm
jubalm / ssl.php
Created August 24, 2012 08:30
PHP - check if SSL is enabled
<?php
function is_ssl() {
if ( isset($_SERVER['HTTPS']) ) {
if ( 'on' == strtolower($_SERVER['HTTPS']) )
return true;
if ( '1' == $_SERVER['HTTPS'] )
return true;
} elseif ( isset($_SERVER['SERVER_PORT']) && ( '443' == $_SERVER['SERVER_PORT'] ) ) {
return true;
}
@reinink
reinink / .htaccess
Last active January 1, 2021 16:14
Add filename-based cache busting to Laravel
<IfModule mod_rewrite.c>
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.+)\.(\d+)\.(css|gif|jpeg|jpg|js|png|svg)$ $1.$3 [L]
</IfModule>
@marlonlom
marlonlom / uuid.demo.js
Created November 20, 2017 02:01
Gist for javascript function that creates universally unique identifier (UUID), which is a 128-bit number used to identify information in computer systems.
console.log(uuid());
@ryanflorence
ryanflorence / entry-server.tsx
Last active August 4, 2022 06:46
Remix + Styled Components
import ReactDOMServer from "react-dom/server";
import type { EntryContext } from "@remix-run/core";
import Remix from "@remix-run/react/server";
import { renderToString } from "react-dom/server";
import { ServerStyleSheet } from "styled-components";
import StylesContext from "./stylesContext";
export default function handleRequest(
request: Request,
@enijar
enijar / plugins.md
Last active August 25, 2022 02:24
Useful
@agektmr
agektmr / gif animation using html5
Last active September 16, 2022 08:13
How to create gif animation
<html>
<head>
<style>
figure {
width: 200px;
height: 150px;
text-align: center;
float: left;
}
img {
@ARolek
ARolek / ImageMagick-Amazon-Linux.md
Last active February 10, 2023 00:07
Install ImageMagick from source on Amazon Linux

I needed a newer version of ImageMagick than is available on the yum packages on Amazon Linux. I tried using the remi repo but it failed with dependency errors. Here is what I did to install ImageMagick with support for PNG, JPG, and TIFF.

download the most recent package

wget http://www.imagemagick.org/download/ImageMagick.tar.gz

uncomress the package

@trey
trey / reset.sass
Created July 31, 2008 20:36
Eric Meyer's reset.css in Sass. Originally by @postpostmodern.
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain) */
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
@ayamflow
ayamflow / .js
Created February 16, 2016 01:37
Three.js - get visible width/height in pixels for an object
// http://stackoverflow.com/a/13351534
var vFOV = this.camera.fov * Math.PI / 180;;
var h = 2 * Math.tan( vFOV / 2 ) * this.camera.position.z;
var aspect = width / height;
var w = h * aspect;