Skip to content

Instantly share code, notes, and snippets.

@mshuffett
mshuffett / .htaccess
Created July 11, 2013 07:59
Angular mod_rewrite rule for html5 mode.
# Apache .htaccess
# angularjs pushstate (history) support:
# See http://www.josscrowcroft.com/2012/code/htaccess-for-html5-history-pushstate-url-routing/
<ifModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !index
RewriteRule (.*) index.html [L]
@Melros
Melros / tinymce-4-email-plugin.js
Last active November 27, 2018 20:21
This plugin will insert a mailto: link by providing an email address within tinymce 4.
/*
1. Create a folder named "email" within "tinymce/plugins".
2. Create a file called "plugin.min.js" within the folder.
2. Paste the below code inside "tinymce/plugins/email/plugin.min.js"
3. Extend your tiny.init like:
tinymce.init({
plugins: "email",
toolbar: "email"
@ibejohn818
ibejohn818 / gist:10954133
Last active February 20, 2019 21:16
Compile FFMpeg & Dependencies - RedHat Linux
# run as root!
yum erase ffmpeg faac libfaac x264 libx264 libvpx -y
yum install gcc gcc-c++ automake autoconf libtool nasm git subversion nasm pkgconfig -y
export LD_LIBRARY_PATH=/usr/local/lib/
echo /usr/local/lib > /etc/ld.so.conf.d/custom-libs.conf
ldconfig
@hans2103
hans2103 / .htaccess-mod_headers
Created April 13, 2015 08:33
.htaccess rules to set cache control.
<IfModule mod_headers.c>
Header set Connection keep-alive
# Cache-control headers
# 2 HOURS
#<filesMatch "*">
Header set Cache-Control "max-age=7200, must-revalidate"
#</filesMatch>
# 480 weeks - 290304000
@Pulimet
Pulimet / AdbCommands
Last active July 17, 2024 12:55
Adb useful commands list
adb help // List all comands
== Adb Server
adb kill-server
adb start-server
== Adb Reboot
adb reboot
adb reboot recovery
adb reboot-bootloader
@rahman541
rahman541 / ES6-Setup.md
Last active May 22, 2023 04:04
ES6 Setup with nodemon

ES6 Setup

npm init -y
npm i --save-dev nodemon
npm add babel-preset-env babel-cli

Create a .babelrc config in your project root. Insert the following

{
 "presets": ["env"]
@crypticmind
crypticmind / README.md
Last active July 12, 2024 09:34
Setup lambda + API Gateway using localstack
@uhooi
uhooi / project.yml
Last active December 5, 2022 15:59
XcodeGen project spec sample
name: {Project Name}
options:
bundleIdPrefix: {Bundle ID Prefix}
deploymentTarget:
iOS: 13.0
xcodeVersion: "11.3.1" # 変わらない?
# findCarthageFrameworks: true # 余計なフレームワークまで追加されてしまうためコメントアウト
carthageExecutablePath: mint run Carthage/Carthage carthage
@brayhoward
brayhoward / getStatusBarHeight.ts
Last active February 10, 2023 07:32
A react hook for getting status bar height in ReactNative that works with iOS and android. This accounts for hotspot and GPS banners
import { useState, useEffect } from "react";
import { NativeModules, StatusBarIOS, Platform, StatusBar } from "react-native";
import get from "lodash/get";
const { StatusBarManager } = NativeModules;
export default function useStatusBarHeight() {
// Initialize w/ currentHeight b/c StatusBar.currentHeight works properly on android on Android
const [height, setHeight] = useState(StatusBar.currentHeight || 0);