Skip to content

Instantly share code, notes, and snippets.

View adrianjguerrero's full-sized avatar
😎

Adrián Guerrero adrianjguerrero

😎
View GitHub Profile
<li>
<h3><a href="#">basic methods</a></h3>
<pre class="code">
<code class="ruby">
def method argument
return splat(argument)
end
</code>
</pre>
</li>
@prime31
prime31 / gist:5675017
Last active May 28, 2024 11:37
Simple PHP script showing how to send an Android push notification. Be sure to replace the API_ACCESS_KEY with a proper one from the Google API's Console page. To use the script, just call scriptName.php?id=THE_DEVICE_REGISTRATION_ID
<?php
// API access key from Google API's Console
define( 'API_ACCESS_KEY', 'YOUR-API-ACCESS-KEY-GOES-HERE' );
$registrationIds = array( $_GET['id'] );
// prep the bundle
$msg = array
@joyrexus
joyrexus / README.md
Last active June 19, 2024 09:35 — forked from liamcurry/gist:2597326
Vanilla JS equivalents of jQuery methods

Sans jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
@lukehedger
lukehedger / ffmpeg-compress-mp4
Last active June 23, 2024 09:29
Compress mp4 using FFMPEG
$ ffmpeg -i input.mp4 -vcodec h264 -acodec mp2 output.mp4
@ziggi
ziggi / parents.js
Last active August 11, 2022 16:10
Vanilla JS jQuery.parents() realisation (npm module: https://github.com/ziggi/dom-parents)
Element.prototype.parents = function(selector) {
var elements = [];
var elem = this;
var ishaveselector = selector !== undefined;
while ((elem = elem.parentElement) !== null) {
if (elem.nodeType !== Node.ELEMENT_NODE) {
continue;
}
@Vestride
Vestride / encoding-video.md
Last active June 5, 2024 14:38
Encoding video for the web

Encoding Video

Installing

Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.

brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus
@seripap
seripap / months.js
Created October 8, 2015 21:32 — forked from bgadrian/months.js
JavaScript JS month names arrays
var month= ["January","February","March","April","May","June","July",
"August","September","October","November","December"];
var month = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul","Aug", "Sep", "Oct", "Nov", "Dec"];
//used with date.getMonth()
@nicovanzyl
nicovanzyl / NaN-batman.js
Last active December 3, 2019 13:43
na na na na na na na na na na na na na na na na Batman! https://www.youtube.com/watch?v=EtoMN_xi-AM
Array(16).join('wat' - 1) + ' Batman!';
@rveitch
rveitch / sass-7-1-pattern.scss
Last active June 24, 2024 12:21
Sass 7-1 Pattern
sass/
|
|– base/
| |– _reset.scss # Reset/normalize
| |– _typography.scss # Typography rules
| ... # Etc…
|
|– components/
| |– _buttons.scss # Buttons
| |– _carousel.scss # Carousel
@juanlopezdev
juanlopezdev / INSTAGRAM_get_token_user.md
Last active May 29, 2020 11:18
Obtener el token de un usuario de instagram

Para obtener el client ID primero debemos registrarnos como desarrollador(https://www.instagram.com/developer/) y crear una aplicación(Manage Clients)

Ejecutar en el navegador lo siguiente:

https://api.instagram.com/oauth/authorize/?client_id=CLIENT-ID&redirect_uri=REDIRECT-URI&response_type=code

Nos redigira a una dirección con el código, abrimo el terminal y ejecutamos el CURL: