Skip to content

Instantly share code, notes, and snippets.

View arnoclr's full-sized avatar
🚂
Focusing

Arno Cellarier arnoclr

🚂
Focusing
  • Marne la Vallée, Île de France
  • 10:32 (UTC +02:00)
View GitHub Profile
@freak4pc
freak4pc / MKMultiPoint+Ext.swift
Last active July 16, 2024 09:10
Get a list of coordinates from a MKPolyline / MKRoute
public extension MKMultiPoint {
var coordinates: [CLLocationCoordinate2D] {
var coords = [CLLocationCoordinate2D](repeating: kCLLocationCoordinate2DInvalid,
count: pointCount)
getCoordinates(&coords, range: NSRange(location: 0, length: pointCount))
return coords
}
}
@travstoll
travstoll / create_issue.php
Created January 15, 2017 16:29
Create GitHub Issue in PHP with File_Get_Contents using GitHub API
<?
//personal auth token from your github.com account. doing this will eliminate having to use oauth everytime
$token = "zzzzzzzzYourPersonalGithubAccessTokenzzzzzzzz";
//post url, https://developer.github.com/v3/issues/
$url = "https://api.github.com/repos/octocat/some_repo/issues?access_token=" . $token;
//request details, removing slashes and sanitize content
$title = htmlspecialchars(stripslashes("Test Title''\s"), ENT_QUOTES);
$body = htmlspecialchars(stripslashes("Test Body'\'$%'s"), ENT_QUOTES);
@Grafikart
Grafikart / gist:a753044d9bfaf622b257
Created April 22, 2015 13:21
Envoy.blade.php pour CakePHP
@servers(['web' => 'tuto@localhost'])
@setup
$dir = "/home/tuto";
$dirlinks = ['tmp/cache/models', 'tmp/cache/persistent', 'tmp/cache/views', 'tmp/sessions', 'tests', 'logs'];
$filelinks = ['config/app.php'];
$releases = 3;
$remote = false;
$shared = $dir . '/shared';
<svg class="loader" width="60" height="60" xmlns="http://www.w3.org/2000/svg">
<g>
<ellipse ry="25" rx="25" cy="30" cx="30" stroke-width="5" stroke="#000" fill="none"/>
</g>
</svg>
@kalinchernev
kalinchernev / countries
Created October 6, 2014 09:42
Plain text list of countries
Afghanistan
Albania
Algeria
Andorra
Angola
Antigua & Deps
Argentina
Armenia
Australia
Austria
@hyg
hyg / gist:9c4afcd91fe24316cbf0
Created June 19, 2014 09:36
open browser in golang
func openbrowser(url string) {
var err error
switch runtime.GOOS {
case "linux":
err = exec.Command("xdg-open", url).Start()
case "windows":
err = exec.Command("rundll32", "url.dll,FileProtocolHandler", url).Start()
case "darwin":
err = exec.Command("open", url).Start()
@mbostock
mbostock / .block
Last active December 11, 2023 06:50 — forked from hail2u/twitter-bird.svg
Twitter SVG Logo
license: gpl-3.0
@MauMaGau
MauMaGau / gist:2301137
Created April 4, 2012 13:45
PHP: time ago
<?php
/* Time ago */
$timestamp = 1332686482; // a unix timestamp
$t = array('year'=>31556926,'month'=>2629744,'week'=>604800,'day'=>86400,'hour'=>3600,'minute'=>60,'second'=>1);
// Calculate how long ago the timestamp is
$diff = time() - $timestamp;
@gre
gre / easing.js
Last active June 27, 2024 15:37
Simple Easing Functions in Javascript - see https://github.com/gre/bezier-easing
/*
* This work is free. You can redistribute it and/or modify it under the
* terms of the Do What The Fuck You Want To Public License, Version 2,
* as published by Sam Hocevar. See the COPYING file for more details.
*/
/*
* Easing Functions - inspired from http://gizma.com/easing/
* only considering the t value for the range [0, 1] => [0, 1]
*/
EasingFunctions = {