Skip to content

Instantly share code, notes, and snippets.

View ajerez's full-sized avatar
💻
Coding

Alberto Jerez ajerez

💻
Coding
View GitHub Profile
@stursby
stursby / hooks.m
Last active August 29, 2015 14:09
↩️ Hooks (http://hooks.events)
// by @itskathuria
NSURL *url = [NSURL URLWithString:@"http://hooks.events/hooks/post.php"];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
[request setHTTPMethod:@"POST"];
[request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"];
NSString *apiKey = @"yourAPIKeyShouldGoHere";
NSString *title = @"yourTitleShouldGoHere";
NSString *message = @"yourMessageShouldGoHere";
NSString *query = [NSString stringWithFormat:@"hooksTitle=%@&hooksMessage=%@&hooksApi=%@", title, message, apiKey];
@dhoerl
dhoerl / UIImage+WhiteImage.m
Created September 20, 2011 17:55
UIImage category to produce a new all white image from any other image. Useful to create white versions of darker icons for use in dark views.
//
// UIImage+WhiteImage.m
//
// Created by David Hoerl on 9/14/11.
// Copyright (c) 2011 David Hoerl. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@HenrikJoreteg
HenrikJoreteg / JS Util solution using underscore.js
Created October 22, 2010 21:20
Rather than creating some other util global, just extend underscore.js with any additional methods you want.
// If you don't use underscore.js, use it (http://documentcloud.github.com/underscore/)
// Then, use underscore's mixin method to extend it with all your other utility methods
// like so:
_.mixin({
escapeHtml: function () {
return this.replace(/&/g,'&')
.replace(/>/g,'>')
.replace(/</g,'&lt;')
.replace(/"/g,'&quot;')
.replace(/'/g,'&#39;');
@gregpalaci
gregpalaci / app.vue
Last active June 7, 2018 07:42
dynamic images from a folder
<template>
<div v-for="(image, index) in images" :key="index">
<img :src='image' alt="image">
</div>
</template>
<script>
const { images } = process.env;
export default {
data() {
@ajerez
ajerez / server.js
Last active March 26, 2019 14:54
server.js for Heroku deployment of a Vue Project with Node and Express.js
let history = require("connect-history-api-fallback");
let express = require("express");
let path = require("path");
let serveStatic = require("serve-static");
let compression = require("compression");
let app = express();
app.use(compression());
app.use(history());
app.use(serveStatic(__dirname + "/dist"));
@ajerez
ajerez / .editorconfig
Created March 26, 2019 14:55
Default editor config for my projects
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
@ajerez
ajerez / Preferences.json
Last active March 26, 2019 14:57
Sublime Text 3 Config
{
"always_show_minimap_viewport": true,
"auto_complete_commit_on_tab": true,
"bold_folder_labels": true,
"color_scheme": "Packages/User/SublimeLinter/Material Spacegray (SL).tmTheme",
"draw_minimap_border": false,
"enable_tab_scrolling": false,
"enable_telemetry": false,
"ensure_newline_at_eof_on_save": false,
"file_exclude_patterns":
@ajerez
ajerez / keybindings.json
Created February 27, 2017 11:39
VSCode Keyboard Shortcuts
[
{
"key": "shift+cmd+7",
"command": "editor.action.addCommentLine",
"when": "editorTextFocus",
"args": { "block": false }
},
{
"key": "shift+cmd+6",
"command": "editor.action.removeCommentLine",
@samvermette
samvermette / gist:1691280
Created January 27, 2012 22:27
MapKit callout bubble pop animation
self.view.layer.anchorPoint = CGPointMake(0.50, 1.0);
CAKeyframeAnimation *bounceAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform.scale"];
bounceAnimation.values = [NSArray arrayWithObjects:
[NSNumber numberWithFloat:0.05],
[NSNumber numberWithFloat:1.08],
[NSNumber numberWithFloat:0.92],
[NSNumber numberWithFloat:1.0],
nil];
@ajerez
ajerez / system-fonts.css
Last active May 13, 2019 10:58
Load System Fonts (CSS)
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}