Skip to content

Instantly share code, notes, and snippets.

@moshe
moshe / reload zshrc with signal howto.md
Last active June 1, 2019 06:17
reload zshrc with signal

How To

Add those lines into your zshrc and now every time you update you zshrc run: reload_zsh

and all you zsh sessions will be updated.

be aware

  • for the first time you must source your zshrc manully otherwise they will terminated
@mhawksey
mhawksey / gist:c2117b6d0e39a9f0fec4
Last active March 23, 2021 10:57
Google Apps Script to add a YouTube video submitted via a form to a YouTube playlist. Read more http://wp.me/p1twQQ-4gW
// this function handles the form submit
function addVideoToPlaylist(e){
// 'Youtube url' is the question title from our form. If you change your question change this value
// youtube_parser() takes the url and strips the video_id
var id = youtube_parser(e.namedValues['Youtube url'][0]);
var desc = e.namedValues['Comment'][0]; // if you would like to add a note with playlist item add form field
addToPlaylist(id, desc);
}
// This function is taken from the YouTube API doc (Javascript example)
@aaronhalford
aaronhalford / chromeos-crosh-custom-setup.md
Created November 28, 2014 19:59
Customize ChromeOS Crosh Terminal with Custom Fonts and Solarized Dark Theme

Customize Chromebook Chrosh Shell Environment

Requirement: Chromebook, Common Sense, Commandline Ablity, 1 hour of time

Dear developers with a spare Chromebook lets inject a little personalization into your Crosh shell with custom fonts, the solarized theme, and extra secure shell options.

Also, keep in mind that the terms Chrosh, Chrosh Window, and Secure Shell all refer to various versions and extentions built around the ChromeOS terminal. Settings that affect the ChromeOS terminal are global.

Custom Fonts

@WebReflection
WebReflection / String.prototype.template.js
Last active August 17, 2022 04:04
ES6 Template like strings in ES3 compatible syntax.
// this is now a module:
// https://github.com/WebReflection/backtick-template#es2015-backticks-for-es3-engines--
var template = require('backtick-template');
// just string
const info = 'template';
`some ${info}` === template('some ${info}', {info});
@hanxi
hanxi / lmd.lua
Created December 16, 2014 08:14
使用LPeg将markdown转成html
local lpeg = require 'lpeg'
local P,S,C,Cs,Cg = lpeg.P,lpeg.S,lpeg.C,lpeg.Cs,lpeg.Cg
local test = [[
A title
---
BTitle
--
CTitle
@marcoonroad
marcoonroad / lazylists.lua
Last active June 3, 2021 00:26
Lazy evaluation on lists (a la Perl6) with Lua... [ FIXED ]
#!/usr/bin/lua
-- Perl6 example --
--[[
my @xs := gather {
my $x = 0;
my $y = 1;
while True {
take $x;
// Bunch of javascript from the YouTubes API sample code which allows me to grab all my daily
// subsciption videos and insert them into a single playlist for easy listening.
// Currently I would have to open each song into a tab and listen to them one by one. Now I can
// just hit 'Play All' on the playlist and listen to all the new posts.
// Define some variables used to remember state.
var playlistId = 'PLyDoEZ08Zam3n_bPBi2ylc_NZV--spj5_';
var channelId;
var playlistArray = [];
@killercup
killercup / Readme.md
Last active August 26, 2023 23:14
Convert The Rust Programming Language to Epub
@mpasternacki
mpasternacki / freebsd_on_mbp.md
Created January 23, 2015 17:12
FreeBSD on a MacBook Pro

FreeBSD on a MacBook Pro

Since 2008 or 2009 I work on Apple hardware and OS: back then I grew tired of Linux desktop (which is going to be MASSIVE NEXT YEAR, at least since 2001), and switched to something that Just Works. Six years later, it less and less Just Works, started turning into spyware and nagware, and doesn't need much less maintenance than Linux desktop — at least for my work, which is system administration and software development, probably it is better for the mythical End User person. Work needed to get software I need running is not less obscure than work I'd need to do on Linux or othe Unix-like system. I am finding myself turning away from GUI programs that I used to appreciate, and most of the time I use OSX to just run a terminal, Firefox, and Emacs. GUI that used to be nice and unintrusive, got annoying. Either I came full circle in the last 15 years of my computer usage, or the OSX experience degraded in last 5 years. Again, this is from a sysadmin/developer ki

@johndgiese
johndgiese / circular_buffer.lua
Last active October 19, 2024 14:40
Circular Buffer in Lua
-- circular buffer factory for lua
local function rotate_indice(i, n)
return ((i - 1) % n) + 1
end
local circular_buffer = {}
local function circular_buffer:filled()