Skip to content

Instantly share code, notes, and snippets.

View dan085's full-sized avatar

Daniel dan085

  • Chile
  • 07:38 (UTC -03:00)
View GitHub Profile
@dan085
dan085 / pregojs.js
Created July 2, 2024 16:49 — forked from lopo12123/pregojs.js
Remove the watermark that comes with gojs
// npm install 之后先使用
// serve-with-gojs/build-with-gojs
// 对 node_module 中相关的文件进行处理
// 去除开源版本的 gojs 自带的水印
const fs = require('fs')
const path = require('path')
const file_js = path.join(__dirname, './node_modules/gojs/release/go.js')
const file_mjs = path.join(__dirname, './node_modules/gojs/release/go.mjs')
const file_module = path.join(__dirname, './node_modules/gojs/release/go-module.js')
@dan085
dan085 / BadgeBarButtonItem.swift
Created October 9, 2021 22:55 — forked from davidlawson/BadgeBarButtonItem.swift
UIBarButtonItem with badge, Swift 4, iOS 9/10/11
import UIKit
public class BadgeBarButtonItem: UIBarButtonItem
{
@IBInspectable
public var badgeNumber: Int = 0 {
didSet {
self.updateBadge()
}
}
@dan085
dan085 / example.js
Created April 6, 2020 02:43 — forked from millermedeiros/example.js
execute multiple shell commands in series on node.js
// USAGE ------
// ============
var shell = require('./shellHelper');
// execute a single shell command
shell.exec('npm test --coverage', function(err){
console.log('executed test');
}});
/ back 버튼 여백 적용 메소드
extension UIImage {
func imageWithInsets(insets: UIEdgeInsets) -> UIImage {
UIGraphicsBeginImageContextWithOptions(
CGSize(width: self.size.width + insets.left + insets.right,
height: self.size.height + insets.top + insets.bottom),
false, self.scale)
guard UIGraphicsGetCurrentContext() != nil else { return UIImage() }
let origin = CGPoint(x: insets.left, y: insets.top)
self.draw(at: origin)
@dan085
dan085 / EndlessRecyclerOnScrollListener.java
Last active September 8, 2019 04:04 — forked from justluvher/EndlessRecyclerOnScrollListener.java
Endless RecyclerView OnScrollListener for pagination b7
public abstract class EndlessRecyclerViewScrollListener extends RecyclerView.OnScrollListener {
// The minimum amount of items to have below your current scroll position
// before loading more.
private int visibleThreshold = 5;
// The current offset index of data you have loaded
private int currentPage = 0;
// The total number of items in the dataset after the last load
private int previousTotalItemCount = 0;
@dan085
dan085 / P12toPEM.txt
Created December 9, 2018 23:15 — forked from shahdhiren/P12toPEM.txt
Convert P12 file for Push Notification to PEM format
Development Phase:
Step 1: Create Certificate .pem from Certificate .p12
Command: openssl pkcs12 -clcerts -nokeys -out apns-dev-cert.pem -in apns-dev-cert.p12
Step 2: Create Key .pem from Key .p12
Command : openssl pkcs12 -nocerts -out apns-dev-key.pem -in apns-dev-key.p12
Step 3: Optional (If you want to remove pass phrase asked in second step)
Command : openssl rsa -in apns-dev-key.pem -out apns-dev-key-noenc.pem
@dan085
dan085 / build.gradle
Created September 21, 2018 20:02 — forked from ph0b/build.gradle
sample build.gradle for generating split APKs per ABI
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig{
minSdkVersion 14
targetSdkVersion 21
versionCode 101
@dan085
dan085 / upload_demo_html.html
Created July 10, 2018 02:01 — forked from paambaati/upload_demo_html.html
Uploading files using NodeJS and Express 4
<html>
<body>
<form action="/upload" enctype="multipart/form-data" method="post">
<input type="text" name="title">
<input type="file" name="file">
<input type="submit" value="Upload">
</form>
</body>
</html>
BIG iOS URL SCHEME LIST
HAD TO MAKE A DROPBOX FILE BECAUSE THIS LIST WAS TOO LONG TO POST IN THE COMMENTS OR NOT MAKE THE WORKFLOW APP TAKE FOREVER TO READ IT.
☠JAILBREAK/SYSTEM APPS
--------------------------
activator://
itms-apps://
itms-services://
@dan085
dan085 / Transantiago public endpoints.md
Created July 12, 2017 03:03 — forked from radutzan/Transantiago public endpoints.md
APIs REST públicas con data del Transantiago. Respuestas en JSON.

Paraderos alrededor de un punto

http://www.transantiago.cl/restservice/rest/getpuntoparada?lat=-33.6089714&lon=-70.5742975&bip=1

Estimación de parada

http://www.transantiago.cl/predictor/prediccion?codsimt=PA420&codser=504 (código de servicio es opcional, pero el parámetro debe estar presente aunque esté vacío)

Lista de servicios

http://www.transantiago.cl/restservice/rest/getservicios/all

Info completa de servicio