Skip to content

Instantly share code, notes, and snippets.

View mre's full-sized avatar
🪴
I like plants.

Matthias Endler mre

🪴
I like plants.
View GitHub Profile
@sebskuse
sebskuse / hunspell.class.php
Created September 27, 2011 09:21
Hunspell-PHP: A hunspell PHP wrapper
<?php
class hunspell {
private $language = "en_US"; // en_US, ar, etc
private $encoding = "en_US.utf-8";
private $raw;
private $hunspellVersion;
@minikomi
minikomi / bookmarklet.js
Created January 16, 2012 01:43
Random colors for dark vim scheme at villistrator
javascript:(function(){var divs=["normalBG","normalFG","commentFG","constantFG","strFG","specFG","identFG","keyFG","incFG","typeFG","funFG","repFG","opFG"];for(var i=1;i<myscopes.length;i++){var randcolstring="";for(var j=0;j<3;j++){var randcol=(Math.floor(Math.random()*256)).toString(16);if(randcol.length==1){randcol="0"+randcol;}randcolstring=randcolstring+randcol;myscopes[i]=randcolstring;}$("#"+divs[i]).ColorPickerSetColor(myscopes[i]);$("#"+divs[i]+" div").css("background-color","#"+myscopes[i]);$("."+divs[i]).css("color","#"+myscopes[i]);}})();
#[derive(Debug)]
struct Person<'a> {
first_name: &'a str,
last_name: &'a str,
}
fn foo1<'bar_lifetime>(bar: &'bar_lifetime str) -> &'bar_lifetime str {
let a = "aa";
anonymous
anonymous / playground.rs
Created August 3, 2017 16:20
Rust code shared from the playground
extern crate libc;
use libc::c_char;
use std::ffi::CString;
fn gimme_cstring_pointer() -> *const c_char {
CString::new("hi").unwrap().as_ptr()
}
fn gimme_cstring() -> CString {
CString::new("hi").unwrap()
@cognitom
cognitom / fb2ical.php
Created May 29, 2011 17:36
Export ical format for Facebook page's events
<?php
// https://github.com/facebook/php-sdk/
require_once 'path/to/facebook.php';
// http://www.kigkonsult.se/iCalcreator/
require_once 'path/to/iCalcreator.class.php';
$config = array(
'appId' => 'xxxx',//change to your fb app id
'secret' => 'yyyy',//change to your fb app secret
'pageId' => 'shimokitazawa.osscafe',//change to target fb page id
@suda
suda / gunicorn
Created December 20, 2010 14:49
Gunicorn init.d script (debian/ubuntu)
#!/bin/sh
### BEGIN INIT INFO
# Provides: gunicorn
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the gunicorn server
# Description: starts gunicorn using start-stop-daemon
@laradevitt
laradevitt / index.html
Last active May 20, 2019 22:57
An adaptation of "Light YouTube Embeds by @labnol". Also embeds Vimeo; didn't need to build thumbnail url. Vanilla JS.
<!doctype html>
<html class="no-js" lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title></title>
<link rel="stylesheet" href="styles.css">
<script src="scripts.js"></script>
@justinmeza
justinmeza / remote.lol
Created December 1, 2014 17:01
connecting to a remote TCP server in LOLCODE
HAI 1.3
CAN HAS SOCKS?
I HAS A local
local R I IZ SOCKS'Z BIND YR "ANY" AN YR 12345 MKAY
BTW get an IP address
I HAS A addr ITZ I IZ SOCKS'Z RESOLV YR "google.com" MKAY
BTW connect to a remote port
@TimFletcher
TimFletcher / gunicorn_startup.sh
Created August 20, 2011 14:45
Gunicorn Startup Script
#!/bin/sh
# http://nathanvangheem.com/news/gunicorn-startup-script-for-django
# Place the script in the file - /etc/init.d/gunicorn or whatever you'd like to call it
# make it executable - chmod +x /etc/init.d/gunicorn
# And finally, wire it up - update-rc.d gunicorn defaults
ADDRESS='127.0.0.1'
PYTHON="/opt/django/bin/python"
GUNICORN="/opt/django/bin/gunicorn_django"
@ceejbot
ceejbot / deploy.yml
Last active August 11, 2021 16:03
Using Honeycomb's buildevents tool inside a github action
name: deploy service tar
on:
push:
branches:
- 'deploy/*'
jobs:
docker:
name: Build and archive service
runs-on: ubuntu-latest