Skip to content

Instantly share code, notes, and snippets.

View filmhomage's full-sized avatar
:octocat:
👨🏻‍💻

Jonghyun Kim filmhomage

:octocat:
👨🏻‍💻
  • Berlin
View GitHub Profile
@AFRUITPIE
AFRUITPIE / fish-build-install.sh
Last active February 27, 2025 17:08
Install Fish Shell 3+ on Raspberry Pi
#!/bin/bash
# This is a quick installer
# script I made to build and install the latest version of
# fish on my Raspberry Pi.
#
# Use at your own risk as I have made no effort to make
# this install safe!
set -e
import React from "react";
import { StyleSheet, Text, View } from "react-native";
import SphericalMercator from "@mapbox/sphericalmercator";
import { MapView, Constants } from "expo";
const merc = new SphericalMercator();
const getZoomLevelFromRegion = (region, viewport) => {
const { longitudeDelta } = region;
const { width } = viewport;
@asgvard
asgvard / FlatSwiper.js
Created November 10, 2017 20:48
Horizontal Paging Swiper based on FlatList
/**
* TODO Finish this for optimized Android swiping
* Inspired by react-native-swiper but based on cross-platform and optimized FlatList
*/
import React, {Component} from 'react';
import PropTypes from 'prop-types';
import {
StyleSheet,
FlatList,
@jsdario
jsdario / nuke-deps.sh
Last active December 12, 2023 08:36
Script to clean watchman, remove node_modules, clean cache and restart packager for React Native troubleshooting.
#!/bin/bash
# Stop cached listeners
watchman watch-del-all
# Remove installed modules
rm -rf node_modules
# Remove yarn meta files
rm yarn*
@davps
davps / install-nodejs-on-raspberrypi-armv6.md
Last active May 8, 2025 00:51
Steps to install nodejs on Raspberry Pi B+ (armv6)

Steps to install nodejs v6.2 on Raspberry Pi B+ (armv6)

cd ~
wget http://nodejs.org/dist/v6.2.1/node-v6.2.1-linux-armv6l.tar.gz
tar -xzf node-v6.2.1-linux-armv6l.tar.gz
node-v6.2.1-linux-armv6l/bin/node -v

The last command should print v6.2.1.

Now you can copy it to /usr/local

@cohenadair
cohenadair / firebase-sandbox.md
Last active December 15, 2024 18:31
Setting up development and production Firebase environments for iOS

Firebase Environments

Last updated: October 21st, 2019.

At the time of writing this gist (January 4th, 2017), I was unable to find true sandboxing to separate development and production environments for a Firebase project. The closest we can get is to create two separate Firebase projects -- one for development and one for production.

Pros

  • Complete separation and isolation of all Firebase features.
  • Freedom to experiment without risking the corruption of production data.

Cons

@chih
chih / showDoneButton.patch
Last active November 2, 2024 22:18
Adding showDoneButton property to react native's TextInput for number fields
diff --git a/node_modules/react-native/Libraries/Text/RCTTextField.h b/node_modules/react-native/Libraries/Text/RCTTextField.h
index c809f10..2d80af4 100644
--- a/node_modules/react-native/Libraries/Text/RCTTextField.h
+++ b/node_modules/react-native/Libraries/Text/RCTTextField.h
@@ -31,5 +31,6 @@
- (void)textFieldDidChange;
- (void)sendKeyValueForString:(NSString *)string;
- (BOOL)textFieldShouldEndEditing:(RCTTextField *)textField;
+- (void)handleDoneButtonFromInputAccessory;
@kevinelliott
kevinelliott / osx-10.11-setup.md
Last active April 15, 2025 05:09
Mac OS X 10.11 El Capitan Setup

Mac OS X 10.11 El Capitan

Custom recipe to get OS X 10.11 El Capitan running from scratch, setup applications and developer environment. This is very similar (and currently mostly the same) as my 10.10 Yosemite setup recipe (as found on this gist https://gist.github.com/kevinelliott/0726211d17020a6abc1f). Note that I expect this to change significantly as I install El Capitan several times.

I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install. On average, I reinstall each computer from scratch every 6 months, and I do not perform upgrades between distros.

This keeps the system performing at top speeds, clean of trojans, spyware, and ensures that I maintain good organizational practices for my content and backups. I highly recommend this.

You are encouraged to fork this and modify it to your heart's content to match your own needs.

@mwaterfall
mwaterfall / StringExtensionHTML.swift
Last active April 17, 2025 13:04
Decoding HTML Entities in Swift
// Very slightly adapted from http://stackoverflow.com/a/30141700/106244
// 99.99% Credit to Martin R!
// Mapping from XML/HTML character entity reference to character
// From http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references
private let characterEntities : [String: Character] = [
// XML predefined entities:
""" : "\"",
"&" : "&",
@kiichi
kiichi / swift-slack.swift
Created June 28, 2015 15:51
Swift Slack Integration
// icon
// http://www.emoji-cheat-sheet.com/
// for test use direct message e.g. @kiichi
let payload = "payload={\"channel\": \"#dev\", \"username\": \"bot\", \"icon_emoji\":\":calling:\", \"text\": \"hello\"}"
let data = (payload as NSString).dataUsingEncoding(NSUTF8StringEncoding)
if let url = NSURL(string: "https://hooks.slack.com/services/(your slack incoming webhook url)")
{
var request = NSMutableURLRequest(URL: url)
request.HTTPMethod = "POST"