Skip to content

Instantly share code, notes, and snippets.

View jthmiranda's full-sized avatar
🎯
Focusing

Jonathan Miranda jthmiranda

🎯
Focusing
View GitHub Profile
@jordansinger
jordansinger / LockScreen.swift
Created May 11, 2020 23:24
Let’s recreate the iPhone lock screen using SwiftUI and Swift Playgrounds on iPad
import SwiftUI
import PlaygroundSupport
struct Screen: View {
var body: some View {
ScrollView {
VStack {
Text("5:45").font(.system(size: 64, weight: .thin))
Text("Monday, May 11").font(.system(size: 24))
}.padding(.vertical, 32)

Technical details for https://stackoverflow.com/a/44169445/6730571

Details of investigation:

On a base system, /usr/bin/java is a symlink that points to /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java, which is an Apple wrapper tool that locates and executes the actual java.

(Do not touch anything in those 2 system directories. It should actually be impossible due to "System Integrity Protection" anyway.)

If you don't have Java installed, attempting to execute java will open a dialog that invites you to install it.

@schnell18
schnell18 / macosx_remove_java9.sh
Created October 8, 2016 13:26
MacOS X remove Java 9
sudo rm -fr /Library/Java/JavaVirtualMachines/jdk-9.jdk/
sudo rm -fr /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin
sudo rm -fr /Library/PreferencePanes/JavaControlPanel.prefPane
@davidfowl
davidfowl / Example1.cs
Last active September 2, 2024 12:36
How .NET Standard relates to .NET Platforms
namespace Analogy
{
/// <summary>
/// This example shows that a library that needs access to target .NET Standard 1.3
/// can only access APIs available in that .NET Standard. Even though similar the APIs exist on .NET
/// Framework 4.5, it implements a version of .NET Standard that isn't compatible with the library.
/// </summary>INetCoreApp10
class Example1
{
public void Net45Application(INetFramework45 platform)
@patrickhammond
patrickhammond / gist:0b13ec35160af758d98c
Created March 8, 2015 02:30
Sample for how to use the Google Play Services dynamic security provider to keep the SSL library that the app will use to up date.
package com.mycompany.myapp.app;
import android.app.Application;
import android.content.Intent;
import com.google.android.gms.common.GooglePlayServicesUtil;
import com.google.android.gms.security.ProviderInstaller;
import com.google.android.gms.security.ProviderInstaller.ProviderInstallListener;
public class MainApplication extends Application {
@kelvinfarfan
kelvinfarfan / installer aeroolib
Created February 20, 2015 17:21
Para la instalacion del los mudulos de Aeroo tiene que instalarse las libreria aeroolib, la cual se instala desde la consola con las linesa de codigo detallas.
cd ~
bzr branch lp:aeroolib
cd aeroolib/aeroolib/
sudo python ./setup.py install
@patrickhammond
patrickhammond / android_instructions.md
Last active November 19, 2024 19:33
Easily setup an Android development environment on a Mac

Here is a high level overview for what you need to do to get most of an Android environment setup and maintained.

Prerequisites (for Homebrew at a minimum, lots of other tools need these too):

  • XCode is installed (via the App Store)
  • XCode command line tools are installed (xcode-select --install will prompt up a dialog)
  • Java

Install Homebrew:

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

@dsggregory
dsggregory / ipaddr.rb
Last active April 4, 2020 04:56
Store an IPv4 or IPv6 network number address in a varbinary(16) column using rails ActiveRecord. This is a decent example of using code to perform the v4/v6 conversion instead of the database. VARBINARY(16) allows one to store the numeric value of an IP address so that you can perform range queries and manage a consistent form with respect to al…
require 'ipaddr'
class Ip < ActiveRecord::Base
attr_accessible :ip, :addr, :other_columns
# The 'addr' accessor is what you use to properly set/get the 'ip' column.
# This sets an instance variable to store the IPAddr class representing the
# ip column in either IPv4 or IPv6.
attr_accessor :addr
validates_presence_of :addr, :message => "Invalid or empty IP Address"
# This file should be placed on the directory of ~/blog/config
upstream unicorn {
server unix:/tmp/unicorn.todo.socket fail_timeout=0;
}
server {
listen 80 default;
#server_name example.com;
root /home/username/blog/public;
@dimoreira
dimoreira / setup.md
Last active December 18, 2015 23:49
Production setup with RVM + Nginx + Unicorn in Ubuntu

Setup the RVM + Nginx + Unicorn in Ubuntu


Init by installing necessary linux headers

$ sudo apt-get update
$ sudo apt-get install build-essential vim git-core curl
$ sudo apt-get install libcurl4-openssl-dev libx11-dev libffi-dev tcl-dev tk-dev