Skip to content

Instantly share code, notes, and snippets.

View jrnk's full-sized avatar

jrnk

  • eu
View GitHub Profile
@jrnk
jrnk / instagram_feed.rb
Last active July 30, 2019 10:41
Get latest instagram photos from profile
# usage:
# ig = Instagram.new(profile: "shrt").images
class Instagram
def initialize(args)
@profile = args[:profile]
@output = args[:output] ? args[:output] : :full
begin
response = HTTP.get("https://www.instagram.com/#{@profile}/")
match_regex = /<script type="text\/javascript">window\._sharedData = (.*);<\/script>/
@jrnk
jrnk / RemoteImage.js
Created October 27, 2016 16:57
Remote image fade in oncomplete - react native
import React, { Component } from 'react'
import { Animated } from 'react-native'
export default class RemoteImage extends Component {
constructor(props) {
super()
this.state = {
fadeAnim: new Animated.Value(0)
}
@jrnk
jrnk / InstagramGateway.php
Created July 1, 2016 09:21
Laravel & Instagram get latest images and cache
<?php
use Cache;
use GuzzleHttp\Client;
// set ENV variables: INSTAGRAM_USERNAME and optional INSTAGRAM_CACHE_TIME (in minutes, default = 60)
class InstagramGateway
{
public function getLatestPhotos($maxNumber = 4)

Keybase proof

I hereby claim:

  • I am jrnk on github.
  • I am jrn (https://keybase.io/jrn) on keybase.
  • I have a public key ASC3f4Mn2dIcpLdBXGkgp8lOXHAFoDVxZKQt-Y4VjtEwIgo

To claim this, I am signing this object:

@jrnk
jrnk / rubocop_pre_commit_hook
Created October 22, 2015 15:47 — forked from mpeteuil/rubocop_pre_commit_hook
Ruby style guide git pre-commit hook using Rubocop as the style guide checker. Only runs on staged ruby files that have been added and/or modified.
#!/usr/bin/env ruby
require 'english'
require 'rubocop'
ADDED_OR_MODIFIED = /A|AM|^M/.freeze
changed_files = `git status --porcelain`.split(/\n/).
select { |file_name_with_status|
file_name_with_status =~ ADDED_OR_MODIFIED
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
green='\033[0;32m'
@jrnk
jrnk / ISO-639-1-language.json
Last active November 8, 2024 16:53
ISO 639-1 Alpha-2 codes of languages JSON
[
{ "code": "aa", "name": "Afar" },
{ "code": "ab", "name": "Abkhazian" },
{ "code": "ae", "name": "Avestan" },
{ "code": "af", "name": "Afrikaans" },
{ "code": "ak", "name": "Akan" },
{ "code": "am", "name": "Amharic" },
{ "code": "an", "name": "Aragonese" },
{ "code": "ar", "name": "Arabic" },
{ "code": "as", "name": "Assamese" },
@jrnk
jrnk / gist:201d5f231088dc8f00ef
Created May 25, 2014 11:41
Reset primary key sequence after database import on all tables (*sql > postgres)
ActiveRecord::Base.connection.tables.each do |table|
ActiveRecord::Base.connection.reset_pk_sequence!(table)
end
@jrnk
jrnk / keybase.md
Created May 23, 2014 14:07
keybase.md

Keybase proof

I hereby claim:

  • I am jrnk on github.
  • I am jrn (https://keybase.io/jrn) on keybase.
  • I have a public key whose fingerprint is AAA7 9323 3125 4E83 A4CC 3F60 A93C 7923 BC82 DC83

To claim this, I am signing this object: