Skip to content

Instantly share code, notes, and snippets.

@bugsysop
bugsysop / git-command.md
Created June 9, 2018 17:35 — forked from aquelito/git-command.md
GIT - Ligne de commande principale

Github

Rappel

Ne pas oublier la base : l'aide en ligne de commande. Il s'agit de la meilleur documentation.

git help config
git help push
@bugsysop
bugsysop / figure.html
Created October 8, 2017 23:44 — forked from budparr/figure.html
Hugo "figure" shortcode that works with https://github.com/aFarkas/lazysizes and uses `markdownify` for title and caption #gohugo
<!-- image -->
<figure {{ with .Get "class" }}class="{{.}}"{{ end }}>
{{ with .Get "link"}}<a href="{{.}}">{{ end }}
<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" data-src="{{ .Get "src" }}" {{ if or (.Get "alt") (.Get "caption") }}alt="{{ with .Get "alt"}}{{.}}{{else}}{{ .Get "caption" }}{{ end }}" {{ end }}{{ with .Get "width" }}width="{{.}}" {{ end }} class="lazyload" />
<noscript>
<img src="{{ .Get "src" }}" {{ if or (.Get "alt") (.Get "caption") }}alt="{{ with .Get "alt"}}{{.}}{{else}}{{ .Get "caption" }}{{ end }}" {{ end }}{{ with .Get "width" }}width="{{.}}" {{ end }}/>
</noscript>
{{ if .Get "link"}}</a>{{ end }}
{{ if or (or (.Get "title") (.Get "caption")) (.Get "attr")}}
<figcaption>{{ if isset .Params "title" }}
@bugsysop
bugsysop / convertnotes.rb
Created August 24, 2017 05:33 — forked from etc/convertnotes.rb
A small script to convert WP-Footnotes style footnotes to PHP Markdown Extra style footnotes.
#!/usr/bin/env ruby
# A small script to convert WP-Footnotes style footnotes to PHP Markdown Extra
# style footnotes.
#
# Possibly useful for those who are migrating from Wordpress to Jekyll, were
# using WP-Footnotes, and wish to render their new Markdown pages with Kramdown
# (which supports PHP Markdown Extra style footnotes).
#
# For example, you might first run https://github.com/thomasf/exitwp and then run
@bugsysop
bugsysop / ifttt-instagram-to-blog.php
Created September 26, 2016 05:14 — forked from bastianallgeier/ifttt-instagram-to-blog.php
IFTTT Make channel action to create blog post from new post on Instagram
<?php
/* if this script is located in your document root… */
require(__DIR__ . '/kirby/bootstrap.php');
if(get('params')) {
$articles = page('blog')->children();
$sort = ($articles->count() + 1);
$date = date('Y-m-d');
# see https://www.topbug.net/blog/2013/04/14/install-and-use-gnu-command-line-tools-in-mac-os-x/
# core
brew install coreutils
# key commands
brew install binutils
brew install diffutils
brew install ed --default-names
brew install findutils --with-default-names
@bugsysop
bugsysop / from.php
Created August 8, 2016 05:34 — forked from judbd/from.php
<?php
/*
CREDITS & LICENCE
------------------------------------------------------------------------------------------------------------------------------
Made by Julien Dubedout / judbd.com
Released under Do What the Fuck You Want to Public License. https://en.wikipedia.org/wiki/WTFPL
PURPOSE
------------------------------------------------------------------------------------------------------------------------------
@bugsysop
bugsysop / PrivateTorrent.md
Created March 28, 2016 15:16 — forked from sourcec0de/PrivateTorrent.md
Host a private torrent tracker, and seed a torrent on ubuntu 12.10

Install dep, and start tracker

sudo apt-get install bittornado ctorrent
bttrack --port 6969 --dfile ~/.bttrack/dstate --logfile ~/.bttrack/tracker.log --nat_check 0 --scrape_allowed full

Now, create a torrent file

ctorrent -t -u "YOUR_SERVER_IP:6969/announce" -s new_file_name.torrent file_or_folder_for_torrent
<?php
/* Merge multiple RSS feeds with SimplePie
*
* Just modify the path to SimplePie and
* modify the $feeds array with the feeds you want
*
* You should probably also change the channel title, link and description,
* plus I added a CC license you may not want
*
* Help from: http://www.webmaster-source.com/2007/08/06/merging-rss-feeds-with-simplepie/
#!/bin/bash
# Takes one parameter: a remote git repository URL.
#
# This is the stuff this script does:
#
# 1. Clones the repository
# 2. Fetches all remote branches
# 3. Compresses the folder
# 4. Deletes the cloned folder.
@bugsysop
bugsysop / kirby-statify.php
Last active March 19, 2017 03:15 — forked from bastianallgeier/statify.php
A first draft for a script, which converts a Kirby site into a static site. It's a rough first draft, so don't expect it to be perfect. Play with it, if you like it!
<?php
/**
* Instructions:
*
* 1. Put this into the document root of your Kirby site
* 2. Make sure to setup the base url for your site correctly
* 3. Run this script with `php statify.php` or open it in your browser
* 4. Upload all files and folders from static to your server
* 5. Test your site