Skip to content

Instantly share code, notes, and snippets.

View andru255's full-sized avatar
🇵🇪
:)

Andrés Muñoz andru255

🇵🇪
:)
View GitHub Profile
@ericclemmons
ericclemmons / example.md
Last active September 20, 2024 12:46
HTML5 <details> in GitHub

Using <details> in GitHub

Suppose you're opening an issue and there's a lot noisey logs that may be useful.

Rather than wrecking readability, wrap it in a <details> tag!

<details>
 Summary Goes Here
@avdyushin
avdyushin / storage.swift
Last active August 28, 2023 14:35
CoreData stack for iOS 9 and iOS 10 using Swift 3
//
// Storage.swift
//
// Created by Grigory Avdyushin on 30.06.16.
// Copyright © 2016 Grigory Avdyushin. All rights reserved.
//
import UIKit
import CoreData
@crisbit
crisbit / ViewWithDynamicWidthScrollingView.swift
Last active June 30, 2024 00:06
How to make a dynamic height scroll view programmatically in swift (using SnapKit)
import Foundation
class ViewWithDynamicWidthScrollingView: UIView {
convenience init() {
self.init(frame: CGRectMake(0, 0, UIScreen.mainScreen().bounds.width, UIScreen.mainScreen().bounds.height))
}
override init(frame: CGRect) {
super.init(frame: frame)
@andru255
andru255 / gist:39c08fd6172c95ee6e779c6a05c9a8c8
Last active September 29, 2018 15:24
Quemar ISO en USB bajo linux
~ sudo dd bs=4M if=/home/dru/Downloads/ubuntu-15.10-desktop-amd64.iso of=/dev/sdb && sync
listar las unidades en consola:
~ df -h
formatear una unidad?
~ sudo mkfs.vfat /dev/sdb -I
fuentes:
http://www.funtoo.org/LiveUSB
export const GoogleApi = function(opts) {
opts = opts || {}
const apiKey = opts.apiKey;
const libraries = opts.libraries || [];
const client = opts.client;
const URL = 'https://maps.googleapis.com/maps/api/js';
const googleVersion = '3.22';
let script = null;
@harto
harto / before.js
Created April 20, 2016 17:33
Mocha before() & beforeEach() execution order with nested describe()
'use strict';
describe('mocha before hooks', function () {
before(() => console.log('*** top-level before()'));
beforeEach(() => console.log('*** top-level beforeEach()'));
describe('nesting', function () {
before(() => console.log('*** nested before()'));
beforeEach(() => console.log('*** nested beforeEach()'));
it('is a nested spec', () => true);
});
@alptugan
alptugan / CONDTIONALS
Last active June 4, 2023 12:21
Sonic Pi Cheat Sheet
So, let’s flip a coin: if it’s heads, play a drum, if it’s tails, play a cymbal. Easy. We can emulate a coin flip with our one_in function (introduced in the section on randomness) specifying a probability of 1 in 2: one_in(2). We can then use the result of this to decide between two pieces of code, the code to play the drum and the code to play the cymbal:
loop do
if one_in(2)
sample :drum_heavy_kick
else
sample :drum_cymbal_closed
end
@briceburg
briceburg / Dockerfile.fails
Created March 30, 2016 22:17
docker - example adding www-data user to alpine images
FROM nginx:alpine
# stock verison from php:alpine image
# ensure www-data user exists
RUN set -x \
&& addgroup -g 82 -S www-data \
&& adduser -u 82 -D -S -G www-data www-data
# 82 is the standard uid/gid for "www-data" in Alpine
# http://git.alpinelinux.org/cgit/aports/tree/main/apache2/apache2.pre-install?h=v3.3.2
@ulhas
ulhas / fastfile
Created March 20, 2016 02:58
Fastfile for HyperTrack iOS SDKs
fastlane_version "1.57.0"
require 'fileutils'
default_platform :ios
platform :ios do
desc "Increment framework version"
private_lane :increment_framework_version do |lane|
@SpacyRicochet
SpacyRicochet / Money.swift
Last active February 9, 2019 12:13
Extension of protocol cannot have inheritance clause
protocol Money {
var value: Double { get }
var inGold: Double { get }
var symbol: String { get }
}
// Sadly, gives a compiler error.
// "Extension of protocol 'Money' cannot have an inheritance clause"
extension Money: CustomStringConvertible {
var description: String {